pkujhd / goloader

load and run golang code at runtime.
Apache License 2.0
506 stars 58 forks source link

how to use it in other program #70

Closed introspection3 closed 1 year ago

introspection3 commented 1 year ago

PS F:\goprjs\study1> go get "github.com/pkujhd/goloader" github.com/pkujhd/goloader imports cmd/objfile/gcprog: package cmd/objfile/gcprog is not in GOROOT (G:\go\src\cmd\objfile\gcprog) github.com/pkujhd/goloader imports cmd/objfile/objfile: package cmd/objfile/objfile is not in GOROOT (G:\go\src\cmd\objfile\objfile) github.com/pkujhd/goloader imports cmd/objfile/sys: package cmd/objfile/sys is not in GOROOT (G:\go\src\cmd\objfile\sys) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/archive: package cmd/objfile/archive is not in GOROOT (G:\go\src\cmd\objfile\archive) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/goobj: package cmd/objfile/goobj is not in GOROOT (G:\go\src\cmd\objfile\goobj) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/objabi: package cmd/objfile/objabi is not in GOROOT (G:\go\src\cmd\objfile\objabi)

module study1

go 1.20

pkujhd commented 1 year ago

PS F:\goprjs\study1> go get "github.com/pkujhd/goloader" github.com/pkujhd/goloader imports cmd/objfile/gcprog: package cmd/objfile/gcprog is not in GOROOT (G:\go\src\cmd\objfile\gcprog) github.com/pkujhd/goloader imports cmd/objfile/objfile: package cmd/objfile/objfile is not in GOROOT (G:\go\src\cmd\objfile\objfile) github.com/pkujhd/goloader imports cmd/objfile/sys: package cmd/objfile/sys is not in GOROOT (G:\go\src\cmd\objfile\sys) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/archive: package cmd/objfile/archive is not in GOROOT (G:\go\src\cmd\objfile\archive) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/goobj: package cmd/objfile/goobj is not in GOROOT (G:\go\src\cmd\objfile\goobj) github.com/pkujhd/goloader imports github.com/pkujhd/goloader/obj imports cmd/objfile/objabi: package cmd/objfile/objabi is not in GOROOT (G:\go\src\cmd\objfile\objabi)

module study1

go 1.20

cp -r $GOROOT/src/cmd/internal $GOROOT/src/cmd/objfile

Please refer to README