Created
March 1, 2019 14:55
-
-
Save udhos/e9da9fecbeb9fe035b8ba62ed9fc2e59 to your computer and use it in GitHub Desktop.
golang anonymous struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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