Skip to content

Instantly share code, notes, and snippets.

@danimal141
Created January 11, 2017 11:08
Show Gist options
  • Save danimal141/cac407377f5270167884cdb1234a7ea9 to your computer and use it in GitHub Desktop.
Save danimal141/cac407377f5270167884cdb1234a7ea9 to your computer and use it in GitHub Desktop.
Go struct to another struct sample
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