- caller
- runtime
Caller filename
examples/caller-filename/caller_filename.go
package main import ( "fmt" "runtime" ) func main() { _, file, _, _ := runtime.Caller(0) fmt.Println(file) }
package main import ( "fmt" "runtime" ) func main() { _, file, _, _ := runtime.Caller(0) fmt.Println(file) }