{"repo":"pkujhd/goloader","free":true,"listed":false,"github":"https://github.com/pkujhd/goloader","clone":"git clone https://github.com/pkujhd/goloader.git","description":"load and run golang code at runtime.","language":"Go","stars":577,"topics":["golang","dynamic","go","plugin"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"Goloader Goloader can load and run Golang code at runtime. Forked from https://github.com/dearplain/goloader , Take over maintenance because the original author is not in maintenance How does it work? Goloader works like a linker: it relocates the address of symbols in an object file, generates runnable code, and then reuses the runtime function and the type pointer of the loader. Goloader provides some information to the runtime and gc of Go, which allows it to work correctly with them. Please note that Goloader is not a scripting engine. It reads the output of Go compiler and makes them runnable. All features of Go are supported, and run just as fast and lightweight as native Go code. Comparison with plugin Goloader reuses the Go runtime, which makes it much smaller. And code loaded by Goloader is unloadable. Goloader supports pprof tool(Yes, you can see code loaded by Goloader in pprof). Build Make sure you're using go = 1.8. First, execute the following command, then do build and test. This is because Goloader relies on the internal package, which is forbidden by the Go compiler. Examples Build Loader: Compile Object File and Run: If use go module or go version = 1.20 If use go path and go version < 1.20 compile with goloaderbuilder compile only package archive compile with dependence packages Warning Don't use \"-s -w\" compile argument, It strips symbol table. Don't use \"go run\" and \"go test\" command, \"-s -w\" compile argument is default. This has currently only been teste","default_branch":null,"files":null,"tree":[],"storefront":"/r/pkujhd","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pkujhd/goloader/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}