What happened?
If you have aliases in your conjure definition and generated go code, then remove all aliases and regenerate the go code into the same directory, the old aliases.conjure.go file and alias definitions still exist when they should not.
$ cat /tmp/defs.yml
types:
definitions:
default-package: com.palantir
objects:
SomeObject:
fields:
someField: string
SomeAlias:
1 types:
alias: string
$ ~/Downloads/conjure-4.6.1/bin/conjure compile /tmp/defs.yml /tmp/defs.json
$ go run main.go /tmp/defs.json --output /tmp/repro
$ cat /tmp/repro/com/palantir/aliases.conjure.go
// This file was generated by Conjure and should not be manually edited.
package palantir
type SomeAlias string
$ vi /tmp/defs.yml # remove alias
$ cat /tmp/defs.yml
types:
definitions:
default-package: com.palantir
objects:
SomeObject:
fields:
someField: string
$ ~/Downloads/conjure-4.6.1/bin/conjure compile /tmp/defs.yml /tmp/defs.json
$ go run main.go /tmp/defs.json --output /tmp/repro
$ cat /tmp/repro/com/palantir/aliases.conjure.go # THIS IS THE BUG -- these defs should no longer exist
// This file was generated by Conjure and should not be manually edited.
package palantir
type SomeAlias string
What did you want to happen?
conjure-go should delete the aliases.conjure.go if there are no aliases.
NOTE: This may apply to other files that conjure-go writes as well.
What happened?
If you have aliases in your conjure definition and generated go code, then remove all aliases and regenerate the go code into the same directory, the old
aliases.conjure.gofile and alias definitions still exist when they should not.What did you want to happen?
conjure-goshould delete thealiases.conjure.goif there are no aliases.NOTE: This may apply to other files that
conjure-gowrites as well.