From 5ecab372f9b4d18fb28615f72a86a739917d3161 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 6 Feb 2016 22:27:43 +0100 Subject: [PATCH] renamed method --- sql.go | 10 +++++----- stringer.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql.go b/sql.go index a672f2d..b4d106b 100644 --- a/sql.go +++ b/sql.go @@ -2,12 +2,12 @@ package main // Arguments to format are: // [1]: type name -const valuer = `func (i %[1]s) Value() (driver.Value, error) { +const valueMethod = `func (i %[1]s) Value() (driver.Value, error) { return i.String(), nil } ` -const scanner = `func (i %[1]s) Scan(value interface{}) error { +const scanMethod = `func (i %[1]s) Scan(value interface{}) error { bytes, ok := value.([]byte) if !ok { return fmt.Errorf("value is not a byte slice") @@ -25,9 +25,9 @@ const scanner = `func (i %[1]s) Scan(value interface{}) error { } ` -func (g *Generator) addValuerAndScanner(typeName string) { +func (g *Generator) addValueAndScanMethod(typeName string) { g.Printf("\n") - g.Printf(valuer, typeName) + g.Printf(valueMethod, typeName) g.Printf("\n\n") - g.Printf(scanner, typeName) + g.Printf(scanMethod, typeName) } diff --git a/stringer.go b/stringer.go index 7e721bb..8276edd 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(typeName) + g.addValueAndScanMethod(typeName) } // splitIntoRuns breaks the values into runs of contiguous sequences.