Re: [go-nuts] where is GOROOT set?

2022-11-17 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2022-11-17 at 21:20 -0800, pat2...@gmail.com wrote: > pfarrell@Alien15:~/whome/sandbox/gows/src/github.com/pfarrell51/cmd$ > go test treesort_test.go This is not how go test should be invoked. You just need to do go test in the directory that you package lives in. See https://pkg.go.dev/c

Re: [go-nuts] where is GOROOT set?

2022-11-17 Thread pat2...@gmail.com
Here I clear it, same result: pfarrell@Alien15:~/whome/sandbox/gows/src/github.com/pfarrell51/cmd$ export GOROOT= pfarrell@Alien15:~/whome/sandbox/gows/src/github.com/pfarrell51/cmd$ printenv GOROOT pfarrell@Alien15:~/whome/sandbox/gows/src/github.com/pfarrell51/cmd$ go test treesort_test.go #

Re: [go-nuts] where is GOROOT set?

2022-11-17 Thread Ian Lance Taylor
On Thu, Nov 17, 2022 at 8:59 PM pat2...@gmail.com wrote: > > I'm missing something fundamental. > I have set GOROOT to my current directory, which contains my go source files > but I can't test a trivial program In general you should never set GOROOT. It's a special purpose hook that is almost n

[go-nuts] where is GOROOT set?

2022-11-17 Thread pat2...@gmail.com
I'm missing something fundamental. I have set GOROOT to my current directory, which contains my go source files but I can't test a trivial program treesort_test.go:11:2: package treesort is not in GOROOT (C:\Program Files\Go\src\treesort) It looks like the value of the GOROOT variable is set to

[go-nuts] X509 subject attributes are encoded as PRINTABLESTRING instead of UTF8STRING

2022-11-17 Thread Atul Mundlik
Hi All, First post on the group, I am using go version go1.18.4 darwin/arm64. I am trying to create X509 certificate with following code. var COMMON_NAME = asn1.ObjectIdentifier([]int{2, 5, 4, 3}) serial := new(big.Int).SetUint64(1) subjectExtraNames = append(subjectExtraNames, pkix.Attribute

[go-nuts] [ANN] go-xmlstruct: generate Go structs from multiple XML documents

2022-11-17 Thread twp...@gmail.com
There are a few existing XML document-to-Go struct generators, but none of them had all of the following features: * Taking multiple XML documents as input. * Generating correct field types. * Customizable field names. * Handling optional and repeated elements. * Ignoring whitespace. If you need

Re: [go-nuts] Re: Retrieve Path Parameters using inbuild http/Net package

2022-11-17 Thread Stéphane Jeandeaux
Hi, Path parameters: http:// /path_parameter_1/path_parameter_2/?query_param1=... The default library does not handle path parameters. If you don't want to use an external library, you can implement your own parsing by using url.EscapedPath. On Thu, Nov 17, 2022 at 9:23 AM Peter Galbavy wrote:

[go-nuts] Re: Retrieve Path Parameters using inbuild http/Net package

2022-11-17 Thread Peter Galbavy
If you look in the http.Request passed to your handler, there is a URL field - use the net/url package to pull this out: https://pkg.go.dev/net/url#URL On Wednesday, 16 November 2022 at 09:08:38 UTC squadglad...@gmail.com wrote: > Hello Everyone, > > I'm developing a http server using inbuilt h