Skip to content

Instantly share code, notes, and snippets.

@lujjjh
Created June 23, 2022 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lujjjh/e92cb9904f8ec8bb42829cea0f6c2400 to your computer and use it in GitHub Desktop.
Save lujjjh/e92cb9904f8ec8bb42829cea0f6c2400 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
"unsafe"
)
type Time struct {
_ uint64
ext int64
}
func main() {
t := time.Now()
u := (*Time)(unsafe.Pointer(&t))
fmt.Println(u.ext)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment