diff options
author | rillig <rillig@pkgsrc.org> | 2015-12-05 10:09:00 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2015-12-05 10:09:00 +0000 |
commit | 445f748f44e4c53c0a64916db8df2a456a1c2563 (patch) | |
tree | a68c715fb044c34998385e8a92f5b965bf3e20fa /pkgtools/pkglint/files/vartype.go | |
parent | 6ae83107ba4e9b39105ebb6d7f47cc8804fd8041 (diff) | |
download | pkgsrc-445f748f44e4c53c0a64916db8df2a456a1c2563.tar.gz |
Code cleanup: converted ALL_CAPS to camelCase
Diffstat (limited to 'pkgtools/pkglint/files/vartype.go')
-rw-r--r-- | pkgtools/pkglint/files/vartype.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/pkgtools/pkglint/files/vartype.go b/pkgtools/pkglint/files/vartype.go index 1b22c897d8e..865268c944a 100644 --- a/pkgtools/pkglint/files/vartype.go +++ b/pkgtools/pkglint/files/vartype.go @@ -17,9 +17,9 @@ type Vartype struct { type KindOfList int const ( - LK_NONE KindOfList = iota // Plain data type - LK_SPACE // List entries are separated by whitespace; used in .for loops. - LK_SHELL // List entries are shell words; used in the :M, :S modifiers. + lkNone KindOfList = iota // Plain data type + lkSpace // List entries are separated by whitespace; used in .for loops. + lkShell // List entries are shell words; used in the :M, :S modifiers. ) type AclEntry struct { @@ -27,11 +27,13 @@ type AclEntry struct { permissions string // Some of: "a"ppend, "d"efault, "s"et; "p"reprocessing, "u"se } +// Whether the type definition is guessed (based on the variable name) +// or explicitly defined (see vardefs.go). type Guessed bool const ( - NOT_GUESSED Guessed = false - GUESSED Guessed = true + guNotGuessed Guessed = false + guGuessed Guessed = true ) // The allowed actions in this file, or "?" if unknown. @@ -81,9 +83,9 @@ func (vt *Vartype) union() string { // the implementation of checklineMkVartype easier. func (vt *Vartype) isConsideredList() bool { switch vt.kindOfList { - case LK_SHELL: + case lkShell: return true - case LK_SPACE: + case lkSpace: return false } switch vt.checker { @@ -94,18 +96,18 @@ func (vt *Vartype) isConsideredList() bool { } func (vt *Vartype) mayBeAppendedTo() bool { - return vt.kindOfList != LK_NONE || + return vt.kindOfList != lkNone || vt.checker == CheckvarAwkCommand || vt.checker == CheckvarSedCommands } func (vt *Vartype) String() string { switch vt.kindOfList { - case LK_NONE: + case lkNone: return vt.checker.name - case LK_SPACE: + case lkSpace: return "SpaceList of " + vt.checker.name - case LK_SHELL: + case lkShell: return "ShellList of " + vt.checker.name default: panic("Unknown list type") |