Skip to content

Instantly share code, notes, and snippets.

@sitano
Created March 15, 2018 21:47
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/55f58c1432b2a06cf059598956ef077d to your computer and use it in GitHub Desktop.
Save sitano/55f58c1432b2a06cf059598956ef077d to your computer and use it in GitHub Desktop.
package main
import "fmt"
type S struct {
b [8]byte
}
func main() {
mmap := map[S]struct{}{
S{b: [8]byte{1}}: struct{}{},
S{b: [8]byte{2}}: struct{}{},
}
var z [][]byte
for k := range mmap {
z = append(z, k.b[:])
}
fmt.Println(z)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment