mirror of https://github.com/dmarkham/enumer.git
style fix
This commit is contained in:
parent
07e2d2fad7
commit
001dec7cc9
11
enumer.go
11
enumer.go
|
@ -3,7 +3,6 @@ package main
|
|||
import "fmt"
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const stringNameToValueMethod = `// %[1]sString retrieves an enum value from the enum constants string name.
|
||||
// Throws an error if the param is not part of the enum.
|
||||
|
@ -20,7 +19,6 @@ func %[1]sString(s string) (%[1]s, error) {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const stringValuesMethod = `// %[1]sValues returns all values of the enum
|
||||
func %[1]sValues() []%[1]s {
|
||||
|
@ -29,7 +27,6 @@ func %[1]sValues() []%[1]s {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const stringsMethod = `// %[1]sStrings returns a slice of all String values of the enum
|
||||
func %[1]sStrings() []string {
|
||||
|
@ -40,7 +37,6 @@ func %[1]sStrings() []string {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const stringBelongsMethodLoop = `// IsA%[1]s returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i %[1]s) IsA%[1]s() bool {
|
||||
|
@ -54,7 +50,6 @@ func (i %[1]s) IsA%[1]s() bool {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const stringBelongsMethodSet = `// IsA%[1]s returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i %[1]s) IsA%[1]s() bool {
|
||||
|
@ -64,7 +59,6 @@ func (i %[1]s) IsA%[1]s() bool {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const altStringValuesMethod = `func (%[1]s) Values() []string {
|
||||
return %[1]sStrings()
|
||||
|
@ -150,7 +144,6 @@ func (g *Generator) printNamesSlice(runs [][]Value, typeName string, runsThresho
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const jsonMethods = `
|
||||
// MarshalJSON implements the json.Marshaler interface for %[1]s
|
||||
|
@ -176,7 +169,6 @@ func (g *Generator) buildJSONMethods(runs [][]Value, typeName string, runsThresh
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const textMethods = `
|
||||
// MarshalText implements the encoding.TextMarshaler interface for %[1]s
|
||||
|
@ -197,7 +189,6 @@ func (g *Generator) buildTextMethods(runs [][]Value, typeName string, runsThresh
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const yamlMethods = `
|
||||
// MarshalYAML implements a YAML Marshaler for %[1]s
|
||||
|
@ -223,7 +214,6 @@ func (g *Generator) buildYAMLMethods(runs [][]Value, typeName string, runsThresh
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const xmlMethods = `
|
||||
// MarshalXML implements a XML Marshaller for %[1]s
|
||||
|
@ -249,7 +239,6 @@ func (g *Generator) buildXMLMethods(runs [][]Value, typeName string, runsThresho
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
const xmlAttrMethods = `
|
||||
// MarshalXMLAttr implements a XML Attribute Marshaller for %[1]s
|
||||
|
|
|
@ -785,7 +785,6 @@ func (g *Generator) buildOneRun(runs [][]Value, typeName string) {
|
|||
}
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
// [2]: size of index element (8 for uint8 etc.)
|
||||
// [3]: less than zero check (for signed types)
|
||||
|
@ -798,7 +797,6 @@ const stringOneRun = `func (i %[1]s) String() string {
|
|||
`
|
||||
|
||||
// Arguments to format are:
|
||||
//
|
||||
// [1]: type name
|
||||
// [2]: lowest defined value for type, as a string
|
||||
// [3]: size of index element (8 for uint8 etc.)
|
||||
|
|
Loading…
Reference in New Issue