diff --git a/plugins/go/go_plugin.c b/plugins/go/go_plugin.c index 95e32816..9ec9d81c 100644 --- a/plugins/go/go_plugin.c +++ b/plugins/go/go_plugin.c @@ -9,6 +9,7 @@ void (*uwsgi_go_helper_env_add_c)(void *, char *, int, char *, int); void (*uwsgi_go_helper_request_c)(void *, struct wsgi_request *); int (*uwsgi_go_helper_signal_handler_c)(int, void *); void (*uwsgi_go_helper_run_core_c)(int); +char *(*uwsgi_go_helper_version_c)(); void uwsgi_go_post_fork() { uwsgi_go_helper_post_fork_c(); @@ -43,6 +44,9 @@ int uwsgi_go_init() { uwsgi_go_get_symbol(uwsgi_go_helper_request) uwsgi_go_get_symbol(uwsgi_go_helper_signal_handler) uwsgi_go_get_symbol(uwsgi_go_helper_run_core) + uwsgi_go_get_symbol(uwsgi_go_helper_version) + + uwsgi_log("Go version \"%s\" initialized\n", uwsgi_go_helper_version_c()); // call PostInit() uwsgi_go_helper_post_init_c(); diff --git a/plugins/go/src/uwsgi/uwsgi.go b/plugins/go/src/uwsgi/uwsgi.go index a143aec1..d274b0c0 100644 --- a/plugins/go/src/uwsgi/uwsgi.go +++ b/plugins/go/src/uwsgi/uwsgi.go @@ -29,6 +29,7 @@ import ( "strings" "strconv" "io" + "runtime" ) // this stores the modifier used by the go plugin (default 11) @@ -386,6 +387,12 @@ func uwsgi_go_helper_request(env *map[string]string, wsgi_req *C.struct_wsgi_req } } +//export uwsgi_go_helper_version +func uwsgi_go_helper_version() *C.char { + v := runtime.Version() + return C.CString(v) +} + //export uwsgi_go_helper_signal_handler func uwsgi_go_helper_signal_handler(signum int, handler *func(int)) int { (*handler)(signum)