package main
/*
#include "runtime.h"
int goId() {
return g->goid;
}
*/
import "C"
import "fmt"
func main() {
x := C.goId()
fmt.Printf("Id - %d", x)
}
jab-MacBook-Pro-4:src debraj$ go build gid.go
# command-line-arguments
./gid.go:4:10: fatal error: 'runtime.h' file not found
#include "runtime.h"
^
1 error generated.
#include <objc/runtime.h>
jab-MacBook-Pro-4:src debraj$ go build gid.go
# command-line-arguments
./gid.go:7:9: error: use of undeclared identifier 'g'
return g->goid;
^
1 error generated.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Z7qTnu3V0dI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
If I get you correctly I still have to pass the Context (with logger attached) to all the functions where I wish to do the logging.If my understanding is not correct then can you please give me a small example?