Why would you want to do that? The amount of stuff going on under the hood in a Go program (GC, scheduling, etc)
make it a bad fit for low level kernel stuff.
So best stick to C.
Writing a Kernel module in C is well supported and documented.
Having a skim through
https://lwn.net/Kernel/LDD3/ .
Recently some people have been writing modules in Rust.
I have not tried it myself, but there is some documentation on the web, eg
https://www.kernel.org/doc/html/latest/rust/quick-start.htmlOr as others have suggested write your program as a plain old user-mode program in Go,
and write a minimal device driver which creates a sys-fs device tree that your program can talk to.