leanring struct... kinda pain in the brain
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
go 1.27.1
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Employee struct {
|
||||||
|
Name string
|
||||||
|
EID int
|
||||||
|
Boss *Employee
|
||||||
|
Hired time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
e := Employee{
|
||||||
|
Name: "Zack",
|
||||||
|
EID: 1,
|
||||||
|
Hired: time.Now(),
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(e.Name, e.Hired.Format(time.RFC1123))
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user