forked from mirror/enumer
removed unnecessary params in function call
This commit is contained in:
parent
42a5bdff6f
commit
9e56f9eb23
|
@ -54,3 +54,6 @@ For more information please refer to the [Stringer docs](https://godoc.org/golan
|
||||||
|
|
||||||
## Additional functions of this fork
|
## Additional functions of this fork
|
||||||
This fork additionally implements the Scanner and Valuer interface to use a enum seamlessly in a database model.
|
This fork additionally implements the Scanner and Valuer interface to use a enum seamlessly in a database model.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
- Add a flag to optionally generate implementation of Scanner und Valuer interface
|
||||||
|
|
2
sql.go
2
sql.go
|
@ -25,7 +25,7 @@ const scanner = `func (i %[1]s) Scan(value interface{}) error {
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
func (g *Generator) addValuerAndScanner(runs [][]Value, typeName string, runsThreshold int) {
|
func (g *Generator) addValuerAndScanner(typeName string) {
|
||||||
g.Printf("\n")
|
g.Printf("\n")
|
||||||
g.Printf(valuer, typeName)
|
g.Printf(valuer, typeName)
|
||||||
g.Printf("\n\n")
|
g.Printf("\n\n")
|
||||||
|
|
|
@ -315,7 +315,7 @@ func (g *Generator) generate(typeName string) {
|
||||||
g.buildValueToNameMap(runs, typeName, 10)
|
g.buildValueToNameMap(runs, typeName, 10)
|
||||||
|
|
||||||
// SQL
|
// SQL
|
||||||
g.addValuerAndScanner(runs, typeName, 0)
|
g.addValuerAndScanner(typeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// splitIntoRuns breaks the values into runs of contiguous sequences.
|
// splitIntoRuns breaks the values into runs of contiguous sequences.
|
||||||
|
|
Loading…
Reference in New Issue