You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate a dataloader with target type time.Time. Example given: //go:generate dataloaden fooLoader int *time.Time
What happen:
Generating fails with:
➜ go-test go generate ./... 16:31:36
validation failed: packages.Load: /home/vanjiii/dev/src/junk/go-test/fooloader_gen.go:9:2: time redeclared in this block
/home/vanjiii/dev/src/junk/go-test/fooloader_gen.go:7:2: other declaration of timeexit status 1
main.go:10: running "go": exit status 1
The generated file fooloader_gen.go
// Code generated by github.com/vektah/dataloaden, DO NOT EDIT.package main
import (
"sync""time""time"
)
// rest of file...
What is expected
The generation to complete.
Workaround
Create a wrapper type:
typeTimestruct {
time.Time
}
Generate the dataloader with the newly created type: //go:generate dataloaden fooLoader int *Time
The text was updated successfully, but these errors were encountered:
What I am trying to do:
Generate a dataloader with target type time.Time. Example given:
//go:generate dataloaden fooLoader int *time.Time
What happen:
Generating fails with:
The generated file fooloader_gen.go
What is expected
The generation to complete.
Workaround
//go:generate dataloaden fooLoader int *Time
The text was updated successfully, but these errors were encountered: