[go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread clementauger888
HI, I m looking for a reliable way to determine if a package path string belongs to the stdlib or not. It happens at runtime, the program can not access its sources. I m thinking to write package that stores those information into package variables, into a map[go version][]packagesPaths. Do y

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread Jan Mercl
On Mon, Nov 26, 2018 at 4:07 PM wrote: > I m looking for a reliable way to determine if a package path string belongs to the stdlib or not. Check that the package path is bellow runtime.GOROOT(). -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread Shulhan
On Mon, 26 Nov 2018 07:07:34 -0800 (PST) clementauger...@gmail.com wrote: > HI, > > I m looking for a reliable way to determine if a package path string > belongs to the stdlib or not. > > It happens at runtime, the program can not access its sources. > > I m thinking to write package that sto

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread clementauger888
Hi, I was not referring to the file system path, i m referring to the import package path. Given the string bytes, reliably tells this is a package that belongs to the stdlib of version Y. I m using the reflect.Type.PkgPath value, to be more specific. Le lundi 26 novembre 2018 16:11:40 UTC+1,

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread clementauger888
thanks! It will be useful, indeed. Le lundi 26 novembre 2018 16:15:51 UTC+1, Shulhan a écrit : > > On Mon, 26 Nov 2018 07:07:34 -0800 (PST) > clement...@gmail.com wrote: > > > HI, > > > > I m looking for a reliable way to determine if a package path string > > belongs to the stdlib or not.

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread Jan Mercl
On Mon, Nov 26, 2018 at 4:55 PM wrote: > I was not referring to the file system path, i m referring to the import package path. FTR: The later is canonically called just "the import path". -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread Ian Lance Taylor
On Mon, Nov 26, 2018 at 7:07 AM wrote: > > I m looking for a reliable way to determine if a package path string belongs > to the stdlib or not. > > It happens at runtime, the program can not access its sources. > > I m thinking to write package that stores those information into package > variab

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-12-06 Thread clementauger888
thanks Ian, i had it done this way https://github.com/clementauger/stdlist/blob/master/raw.go Le lundi 26 novembre 2018 21:06:24 UTC+1, Ian Lance Taylor a écrit : > > On Mon, Nov 26, 2018 at 7:07 AM > > wrote: > > > > I m looking for a reliable way to determine if a package path string > belo