package main import "fmt" type A struct { id int } type Builder interface { add() A remove() A } func (a A) add(el int) A{ a.id = el return a } func (a A) remove() A{ a.id = 0 return a } func main() { n := A{1} fmt.Println(n.add(2).remove()) }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up