Skip to content

Instantly share code, notes, and snippets.

@infogulch infogulch/blah.go
Last active Sep 22, 2015

Embed
What would you like to do?
Test file for /clipperhouse/gen/pull/65
package main
package main
// +gen
type Thing int
func main() {
x := Things{2,1,3}
x = x.Sort()
x = x.Where(func(t Thing) bool { return true })
x = x.SortDesc()
min, _ := x.Min()
// x.Each(func(t Thing) { return })
println(min)
}
/*
Steps:
* Write the contents of this file to `main.go`.
* Run `gen`. It should complain about 'Things' being undefined, but continue
anyway and write `thing_gen.go` with *all* methods defined.
* Run `gen` again, twice. Now `thing_gen.go` should only include the methods
used in this file.
Simulating maintenance:
* Uncomment the Each line and run `gen` again. It will complain about Each not
being defined, but it should generate the templates just fine.
* Comment the Each line out again and run `gen`. The definition of Each should
dissapear from `thing_gen.go`.
The source should build successfully with `go build` just after running `gen`
for all the steps above.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.