mchirico / agil

Golang GraphQL Query of Github Projects
Apache License 2.0
0 stars 0 forks source link

Go Structs Copy #33

Open mchirico opened 4 years ago

mchirico commented 4 years ago

playground

// ref: https://play.golang.org/p/oculgcMf_9P
package main

import (
    "fmt"
)

type Cat struct {
    age     int
    name    string
    friends []string
}

func main() {
    wilson := &Cat{7, "Wilson", []string{"Tom", "Tabata", "Willie"}}
    nikita := *wilson

    wilson.age = 62
    wilson.name = "Dr. Wilson"

    nikita.friends = append(nikita.friends, "Syd")

    fmt.Println(*wilson)
    fmt.Println(nikita)
}
issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.77. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

tacomonkautobot[bot] commented 4 years ago

mchirico, Thanks for opening this issue!