Skip to content

Commit 31d759d

Browse files
committed
add sort flag to control the order of emitted builder functions
1 parent b8da330 commit 31d759d

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

constants.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "regexp"
44

55
// Version information
66
const (
7-
Version = "0.14.0"
7+
Version = "0.15.0"
88
)
99

1010
// File extensions and suffixes
@@ -17,7 +17,6 @@ const (
1717
const (
1818
FlagInput = "input"
1919
FlagGenerateFor = "generate-for"
20-
FlagReceiver = "receiver"
2120
FlagConstructor = "constructor"
2221
FlagSort = "sort"
2322
FlagVersion = "print-version"

example/structs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"time"
55
)
66

7-
//go:generate ../gobetter -input $GOFILE
7+
//go:generate ../gobetter -input $GOFILE -sort=abc
88

99
type S struct { //+gob:Constructor
1010
Identifier string

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ func generateCodeForFile(inputFile, outputFile string, config *Config) error {
541541
// Compare by exported method name (respects acronym setting)
542542
li := exportName(structFields[i].FieldName, structFields[i].Acronym)
543543
lj := exportName(structFields[j].FieldName, structFields[j].Acronym)
544-
return li < lj
544+
return strings.ToLower(li) < strings.ToLower(lj)
545545
})
546546
}
547547

0 commit comments

Comments
 (0)