Skip to content

Instantly share code, notes, and snippets.

@udhos
Created March 1, 2019 14: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 udhos/e9da9fecbeb9fe035b8ba62ed9fc2e59 to your computer and use it in GitHub Desktop.
Save udhos/e9da9fecbeb9fe035b8ba62ed9fc2e59 to your computer and use it in GitHub Desktop.
golang anonymous struct
// https://play.golang.org/p/mJYbMCxYbbK
package main
import (
"fmt"
)
func main() {
var employee struct {
name string
age int
}
employee.name = "John"
employee.age = 77
fmt.Println(employee)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment