Created
January 11, 2017 11:08
-
-
Save danimal141/cac407377f5270167884cdb1234a7ea9 to your computer and use it in GitHub Desktop.
Go struct to another struct sample
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
package main | |
import ( | |
"fmt" | |
) | |
type aaa struct { | |
CCC int | |
} | |
type bbb struct { | |
CCC int | |
} | |
func main() { | |
a := aaa{3} | |
var x struct{ CCC int } = a | |
var b bbb = x | |
fmt.Println("ok", b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment