Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ func TestTypeOverrides(t *testing.T) {
"string",
true,
},
{
Override{
DBType: "timestamp",
GoType: GoType{Spec: "time.Time"},
},
"time",
"time.Time",
false,
},
} {
tt := test
t.Run(tt.override.GoType.Spec, func(t *testing.T) {
Expand Down Expand Up @@ -167,7 +176,7 @@ func TestTypeOverrides(t *testing.T) {
t.Run(tt.override.GoType.Spec, func(t *testing.T) {
err := tt.override.Parse()
if err == nil {
t.Fatalf("expected pars to fail; got nil")
t.Fatalf("expected parse to fail; got nil")
}
if diff := cmp.Diff(tt.err, err.Error()); diff != "" {
t.Errorf("error mismatch;\n%s", diff)
Expand Down
3 changes: 0 additions & 3 deletions internal/config/go_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ func (gt GoType) Parse() (*ParsedGoType, error) {
if lastDot == -1 {
return nil, fmt.Errorf("Package override `go_type` specifier %q is not the proper format, expected 'package.type', e.g. 'github.com/segmentio/ksuid.KSUID'", input)
}
if lastSlash == -1 {
return nil, fmt.Errorf("Package override `go_type` specifier %q is not the proper format, expected 'package.type', e.g. 'github.com/segmentio/ksuid.KSUID'", input)
}
typename = input[lastSlash+1:]
// a package name beginning with "go-" will give syntax errors in
// generated code. We should do the right thing and get the actual
Expand Down