gokursu/structs/demo2.go
2024-01-20 18:24:00 +03:00

23 lines
393 B
Go

package structs
import "fmt"
type customer struct{
firstName string
lastName string
age int
}
func (c customer) save() {
fmt.Println("Has been added : ", c.firstName, c.lastName,c.age)
}
func (c customer) update() {
fmt.Println("Updated : ", c.firstName, c.lastName, c.age)
}
func Demo2() {
c:= customer{firstName: "Engin", lastName: "Demiroğ", age: 35}
c.save()
c.update()
}