diff --git a/README.md b/README.md index e6b2ca7..53022d0 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,6 @@ For more information please refer to the [Stringer docs](https://godoc.org/golan ## Additional functions of this fork 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 diff --git a/sql.go b/sql.go index 4851fae..5adf318 100644 --- a/sql.go +++ b/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(valuer, typeName) g.Printf("\n\n") diff --git a/stringer.go b/stringer.go index 0944bc0..7e721bb 100644 --- a/stringer.go +++ b/stringer.go @@ -315,7 +315,7 @@ func (g *Generator) generate(typeName string) { g.buildValueToNameMap(runs, typeName, 10) // SQL - g.addValuerAndScanner(runs, typeName, 0) + g.addValuerAndScanner(typeName) } // splitIntoRuns breaks the values into runs of contiguous sequences.