Skip to content

Instantly share code, notes, and snippets.

@sitano
Created March 15, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sitano/967664217a0fb531a9dd59d65997c603 to your computer and use it in GitHub Desktop.
Save sitano/967664217a0fb531a9dd59d65997c603 to your computer and use it in GitHub Desktop.
env GOSSAFUNC=keys go build for_keys_go_issue2.go
package main
import "fmt"
type S struct {
b [8]byte
}
func keys(m map[S]struct{}) [][]byte {
var z [][]byte
for k := range m {
z = append(z, k.b[:])
}
return z
}
func main() {
fmt.Println(keys(map[S]struct{}{
S{b: [8]byte{1}}: struct{}{},
S{b: [8]byte{2}}: struct{}{},
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment