Skip to content

Instantly share code, notes, and snippets.

@billglover
Created June 17, 2020 18:57
Show Gist options
  • Save billglover/30801918a026cb1cd8875ce9b3adcb9c to your computer and use it in GitHub Desktop.
Save billglover/30801918a026cb1cd8875ce9b3adcb9c to your computer and use it in GitHub Desktop.
Cross Compilation Demo
import (
"fmt"
"sync/atomic"
)
type T struct {
a byte
b int64
}
func main() {
t := T{}
fmt.Println("before:", t.b)
atomic.AddInt64(&(t.b), 1)
fmt.Println("after:", t.b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment