| # Test that a basic get go works using --local |
| |
| # All the things |
| cue get go --local |
| cmp blah_go_gen.cue all.cue.golden |
| |
| # Verify dependencies did not change |
| cmp go.mod go.mod.golden |
| |
| # Use an alternative package name |
| cue get go --local -p other |
| cmp blah_go_gen.cue other.cue.golden |
| |
| # Verify dependencies did not change |
| cmp go.mod go.mod.golden |
| |
| -- go.mod -- |
| module mod.com/blah |
| |
| go 1.14 |
| -- go.mod.golden -- |
| module mod.com/blah |
| |
| go 1.14 |
| -- blah.go -- |
| package main |
| |
| type T struct { |
| Age int |
| } |
| -- all.cue.golden -- |
| // Code generated by cue get go. DO NOT EDIT. |
| |
| //cue:generate cue get go mod.com/blah |
| |
| package main |
| |
| #T: Age: int |
| -- other.cue.golden -- |
| // Code generated by cue get go. DO NOT EDIT. |
| |
| //cue:generate cue get go mod.com/blah |
| |
| package other |
| |
| #T: Age: int |