[go-nuts] Fun way to learn about Go (and others langages)

2016-12-11 Thread Jérôme LAFORGE
Hello all, My workmate pointed me a funny web site for working/learning about Go (and others language) with lot of fun. https://www.codingame.com By the way, you can find here the result of one of my first challenges: https://www.codingame.com/replay/solo/167065503 (you have to drive the man

[go-nuts] Run some extra setup on each test

2016-12-02 Thread Jérôme LAFORGE
Hello all, Do you know an elegant workaround that allows to execute extra setup on each test (kind of TestMain but for each test) ? If not, did you plan to add this kind of feature into next release of Go ? Thank in advance. BR Jérôme -- You received this message because you are subscribed to

Re: [go-nuts] Re: [golang-dev] go version inconsistency with Linux and Windows

2016-12-05 Thread Jérôme LAFORGE
Thx all for the support. Le 5 déc. 2016 7:45 PM, "Björn Graf" a écrit : > On Mon, Dec 5, 2016 at 5:53 PM, Russ Cox wrote: > > > > [+golang-nuts, bcc golang-dev, per golang.org/wiki/Questions] > > > > On Mon, Dec 5, 2016 at 10:24 AM,

[go-nuts] Kafka with "At least once" for message delivery guarantees

2016-12-21 Thread Jérôme LAFORGE
Hello all, I am looking for feedback about Kafka consumer driver, that can allow "*At least once*" for message delivery guarantees (as described here https://kafka.apache.org/documentation/#semantics). Currently, from my point of view the only driver can manage this, it is

[go-nuts] Converting Panic into Error

2017-03-24 Thread Jérôme LAFORGE
Hello, Try this: func MustNotPanic() (err error) { defer func(){ err=recover() }() PanicFunction() } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it,

[go-nuts] [ANN] sqlite

2017-04-20 Thread Jérôme LAFORGE
Hello, It is driver only or that contains also the process that manages the data via sql? Thx in advance. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [go-nuts] Go Path & Github Sync

2017-04-05 Thread Jérôme LAFORGE
>From my experience/point of view, GOPATH is the first concept you have to >understand for managing correctly your project. Even if this concept is finally simple. IMHO, this is the first strange/bad feeling with Go. And lot of my workmates prefer to not start a new project alone (even if the

Re: [go-nuts] Re: Generics are overrated.

2017-07-30 Thread Jérôme LAFORGE
> As with every community, there's the silent majority and the vocal minority. But when we let the community to manifeste it choice (even if little part of this community that reply to survey) in regarding the 2016 golang survey: What changes would improve Go most? 1 generics -- You received

[go-nuts] job opportunities

2017-07-14 Thread Jérôme LAFORGE
Hello, What kind of project? What is the range of salary? Regards. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.

[go-nuts] How do you test a server?

2017-07-19 Thread Jérôme LAFORGE
One of my favorite resource can be found here about testing server https://github.com/bradfitz/talk-yapc-asia-2015/blob/master/talk.md#testing -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Go Styleguide

2017-07-31 Thread Jérôme LAFORGE
Maybe you can take a look at https://peter.bourgon.org/go-best-practices-2016/ Some part of this Peter's practices are sweet. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it,

[go-nuts] Test, test coverage & httptest.Server

2017-05-21 Thread Jérôme LAFORGE
Hello, I create a classic rest server with mongo database. Some of my tests are made like this : - at the begining of test, I launch mononDB into docker contener (thx to https://github.com/ory/dockertest) - I launch my rest server within httptest.Server

[go-nuts] Re: Test, test coverage & httptest.Server

2017-06-18 Thread Jérôme LAFORGE
Hello, Can I consider that no workaround? Thx Le dimanche 21 mai 2017 09:48:01 UTC+2, Jérôme LAFORGE a écrit : > > Hello, > I create a classic rest server with mongo database. Some of my tests are > made like this : > - at the begining of test, I launch mononDB into docke

[go-nuts] iota with gaps

2017-05-02 Thread Jérôme LAFORGE
const ( _ = iota One Two Three _ _ _ Seven Eight Nine ) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more

Re: [go-nuts] Why constant is not addressable in golang?

2017-08-21 Thread Jérôme LAFORGE
> May I ask why it would be interesting to take the address of a constant? I have been already faced to this case. I usually use go swagger to generate the model from swagger spec. Go swagger generates some structure with field pointer (for example for string) where I always put the same value.

[go-nuts] swagger

2017-12-04 Thread Jérôme LAFORGE
In my previous projects, I used go-swagger successfully: - to generate code (model) from swagger (still some little bugs sometimes) - to generate swagger file from code based on godoc (you have to follow specific format of godoc. The document is not very clear imho) -- You received this

Re: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-10-30 Thread Jérôme LAFORGE
Thx Giovanni, it is clear now. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Re: Table Driven Test (TDT) and log only failed test case

2018-01-30 Thread Jérôme LAFORGE
nstead of `fmt.Printf`. > > On Saturday, January 27, 2018 at 6:03:13 AM UTC-6, Jérôme LAFORGE wrote: >> >> Of course, that was I already did. But I talk about the log into function >> I want to test (in the example of playground: func IsBuggyEven) . >> see: >> https://pl

[go-nuts] Re: Table Driven Test (TDT) and log only failed test case

2018-01-29 Thread Jérôme LAFORGE
Is it worth opening an issue? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Re: Table Driven Test (TDT) and log only failed test case

2018-01-27 Thread Jérôme LAFORGE
Of course, that was I already did. But I talk about the log into function I want to test (in the example of playground: func IsBuggyEven) . see: https://play.golang.org/p/OWnEntLwfXa check 0 is even or odd, but I want see this log only for fail test case (i.e when i == 5) check 2 is even or

Re: [go-nuts] go fmt and CI (e.g. gitlab)

2018-02-20 Thread Jérôme LAFORGE
e > /dev/stderr)" > > Thanks and regards, > Stephane Jeandeaux. > > On Mon, Feb 19, 2018 at 6:44 AM Jérôme LAFORGE <jerome@gmail.com > > wrote: > >> Hello Gophers, >> Has any one of you setted up the validation of format (goimports, go fmt) >>

[go-nuts] go fmt and CI (e.g. gitlab)

2018-02-19 Thread Jérôme LAFORGE
Hello Gophers, Has any one of you setted up the validation of format (goimports, go fmt) into Gitlab CI? My goal is to reject the commit that doesn't respect the Go's format. Thx in adv BR -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] omitempty by default

2018-04-12 Thread Jérôme LAFORGE
Hello Gophers, Is there any way I set omitempty by default for specific json.Encoder or in fallback on global configuration ? Thx in adv. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] The Go code formatter

2018-04-18 Thread Jérôme LAFORGE
I have already confronted to this problem with table driven test. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For

[go-nuts] constructors vs lazy initialization

2018-03-03 Thread Jérôme LAFORGE
Not sure that is relevant for your example, but if do can be called by multiple goroutines, then you have to use atomic.Once (store within the struct) in order to initialize. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Modules upgrade none transitive modules (aka direct modules)

2018-11-04 Thread Jérôme LAFORGE
Hello all, I am looking for a way to upgrade all none transitive modules (and eventually upgrade transitive modules according to go.mod from upgraded none transitive modules). Beause go get -u, upgrade all modules (transitive and none transitive modules). Thx in adv Jerome -- You received

[go-nuts] Re: Modules upgrade none transitive modules (aka direct modules)

2018-11-04 Thread Jérôme LAFORGE
ect dependencies would I think allow > people to more easily retain more benefits of the module system's > philosophy of 'High-Fidelity Builds' (by at least having the option to more > easily apply that philosophy during an upgrade). > > In any event, I'd be curious to hear more about your

[go-nuts] Re: mongodb driver for go

2018-12-14 Thread Jérôme LAFORGE
Hello, We also use this driver https://godoc.org/github.com/globalsign/mgo in production with pb. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Re: mongodb driver for go

2018-12-14 Thread Jérôme LAFORGE
Sorry, mistyping: We are using globalsign driver without problem in production. For your information, globalsign is fork of https://godoc.org/gopkg.in/mgo.v2 since mgo.v2 is unmaintained. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Http server, async tasks and gracefully shutdown.

2018-12-10 Thread Jérôme LAFORGE
Hello World, In order to manage async tasks with callback on http , I have to reply to my customer for example with 202 Accepted, and keep some works with a new goroutine. I habitually use server.Shutdown() and sync.Waitgroup in order to gracefully shutdown the application when all requests

Re: [go-nuts] Why is this code runs sequentially?

2018-12-08 Thread Jérôme LAFORGE
By the way, the readers of channel must not close a channel. Only writer can closes it to indicate to reader that channel is closed and nothing can be read from it. You can let channel opens (there is no resource leak), it will be garbage collected anyway. -- You received this message because

[go-nuts] net/http: expose dialing + writing errors from net package

2019-02-28 Thread Jérôme LAFORGE
Hello Gophers, (I have already asked this question at https://github.com/golang/go/issues/14203#issuecomment-467785036) I want to know whether the error on http.Get("http://some.where;) is produced before or after httpclient sent the request (e.g. during tcp dial, tls or write request body in

[go-nuts] go modules and ambiguous import, how to fix it?

2019-05-17 Thread Jérôme LAFORGE
Hello, I try to upate all dependencies from my module (go get -u), but I have a this error: build myModule: cannot load github.com/ugorji/go/codec: ambiguous import: found github.com/ugorji/go/codec in multiple modules: github.com/ugorji/go v1.1.4

[go-nuts] Re: go modules and ambiguous import, how to fix it?

2019-05-17 Thread Jérôme LAFORGE
How can I import this both modules without ambiguous? https://play.golang.org/p/YgrEmcTallk Thx for your help. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Re: go modules and ambiguous import, how to fix it?

2019-05-18 Thread Jérôme LAFORGE
n in: >> https://github.com/gin-gonic/gin/issues/1897 >> https://github.com/golang/go/issues/29332#issuecomment-448669442 >> >> It probably also makes sense to open a clean new issue on the Go issue >> tracker with your example, and ask for a clearer diagnostic message or a

Re: [go-nuts] Compilation fails when adding option "-trimpath", because change a dependency to require gcc

2020-02-05 Thread Jérôme LAFORGE
> I haven't verified this, so this is just a guess, but perhaps without > -trimpath the go tool is using the prebuilt runtime/cgo.a, which was > built on a system with a C compiler. When you add -trimpath, the > runtime/cgo package needs to be rebuilt in order to trim the paths. >

[go-nuts] array json streaming inside json object

2020-02-19 Thread Jérôme LAFORGE
Hello, Do you know an elegant, simple and clean way to stream an json array inside json object? Here an example, that does the job, but I find it complicated (and how we manage the comma when document has error and we have to ignore it) https://play.golang.org/p/lZa8iVaQAKg thx in adv BR

[go-nuts] Re: array json streaming inside json object

2020-02-20 Thread Jérôme LAFORGE
Thank you both. When I am the designer of API that must stream json array, I use JSONL. And it is much easier to use it as sender. Unfortunately, in this case, I can't modify the API. I read somewhere (I can't remember where), that somebody plans to work on simplicity for streaming json

[go-nuts] modules exclude version and above

2020-01-03 Thread Jérôme LAFORGE
Hello, Does it exist a way to exclude modules' version and above ? Currently I have to do this (in order to not use v2) in my go.mod: exclude ( github.com/nicksnyder/go-i18n v2.0.1+incompatible github.com/nicksnyder/go-i18n v2.0.2+incompatible github.com/nicksnyder/go-i18n

[go-nuts] Re: modules exclude version and above

2020-01-06 Thread Jérôme LAFORGE
I use this version: go version go1.13.5 linux/amd64 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this

[go-nuts] Re: modules exclude version and above

2020-01-06 Thread Jérôme LAFORGE
Thx for your support. > Could you provide explicit steps (ideally a `go.mod` file and a corresponding `.go` source file, and the version of the Go toolchain you are using) to reproduce the problem? With this go.mod https://play.golang.org/p/PeSbMFMAsHf & with go get -u ./... the version stills

[go-nuts] Re: modules and indirect

2020-04-12 Thread Jérôme LAFORGE
golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef ) Regards, Jérôme Le mardi 7 avril 2020 08:20:26 UTC+2, Jérôme LAFORGE a écrit : > > Hello Gophers, > In view of this this commit > https://github.com/go-kit/kit/commit/362dd5cb62daf3def58ab021538cee272164dd26 > (I

[go-nuts] modules and indirect

2020-04-07 Thread Jérôme LAFORGE
Hello Gophers, In view of this this commit https://github.com/go-kit/kit/commit/362dd5cb62daf3def58ab021538cee272164dd26 (I have noted the same on my internal projects), I am surprised that go mod tidy doesn't remove all unnecessary dependencies from the go.mod. It raises some questions: - Is

[go-nuts] semantic versioning & Deprecated function

2020-10-09 Thread Jérôme LAFORGE
Hello Gophers, >From your point of view, is it acceptable to deprecate (// Deprecated: xxx) a function or something else into a Module with the change on its patch version number? (from 1.0.0 to 1.0.1). Thx in adv Best Jérôme -- You received this message because you are subscribed to the

[go-nuts] Re: semantic versioning & Deprecated function

2020-10-10 Thread Jérôme LAFORGE
if any public > API functionality is marked as deprecated. > https://semver.org/#spec-item-7 > > Peter > > On Friday, October 9, 2020 at 2:40:58 PM UTC-4, Jérôme LAFORGE wrote: > >> Hello Gophers, >> From your point of view, is it acceptable to deprecate

[go-nuts] Re: [modules] List available only patch upgrades

2020-08-23 Thread Jérôme LAFORGE
Hello, I have just created this issue: https://github.com/golang/go/issues/40990 Regards, Jérôme Le vendredi 14 août 2020 19:21:20 UTC+2, Jérôme LAFORGE a écrit : > > Hello Gophers, > > I want to list modules available only for available only patch upgrades. > The given exampl

[go-nuts] [modules] List available only patch upgrades

2020-08-14 Thread Jérôme LAFORGE
Hello Gophers, I want to list modules available only for available only patch upgrades. The given example here https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies is for direct with minor and patch (I just want patch) I want use this in my CI with

[go-nuts] http.MaxByteReader & http: request body too large

2020-09-18 Thread Jérôme LAFORGE
Hello, I want to use http.MaxByteReader, but I want to know if it possible to return an package level error (like context.DeadlineExceeded) instead of create a new one (https://github.com/golang/go/blob/06f7e655d1764f5ad57bc14f82326c181c37901c/src/net/http/request.go#L1158). It seems more

[go-nuts] xml easily encode iso-8859-1 charset

2020-10-28 Thread Jérôme LAFORGE
Hello Gophers, How can I encode easily struct with iso-8859-1 charset ? How can I switch easily to one charset to another? For example within this playground, I like to select specific charset. https://play.golang.org/p/4HGSO7ivoN3 Thx in adv Jérôme -- You received this message because you

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
I submit this issue https://github.com/golang/go/issues/46826 Le vendredi 18 juin 2021 à 21:15:54 UTC+2, Jérôme LAFORGE a écrit : > Sorry, I wasn't clear enough. > I know that panic comes from my code. It throws it. > But I wanted to show that error on Decode must not occur because

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-21 Thread Jérôme LAFORGE
eeded *and* w has that method. But I've checked and it >> doesn't. >> >> On Saturday, 19 June 2021 at 06:19:22 UTC+1 jerome@gmail.com wrote: >> >>> I submit this issue https://github.com/golang/go/issues/46826 >>> >>> Le vendredi 18 juin

[go-nuts] unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
Hello, I am facing to unexpected behavior when I want to limit the maximum body request and managing the request/response as streaming way. With this code https://play.golang.org/p/eN2XEpiPdhn, when I send the request, I have this unexpected error (whatever the max size): ``` 2021/06/18

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Jérôme LAFORGE
Sorry, I wasn't clear enough. I know that panic comes from my code. It throws it. But I wanted to show that error on Decode must not occur because the body is smaller than 8kB. The 2nd example works like this. The only difference between the two examples is just the response is discarded.

[go-nuts] Re: How to wait for HTTP server to start?

2021-03-27 Thread Jérôme LAFORGE
When I want to ensure that the HTTP server is started (or if I want additional stuff), I do this : https://play.golang.org/p/mX0OsNWFf-f Le samedi 27 mars 2021 à 15:13:40 UTC+1, cpu...@gmail.com a écrit : > The typical Go tutorials pattern for starting a server is something like > >

[go-nuts] Re: [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-10 Thread Jérôme LAFORGE
Hello all, For testing purpose, how can I install Go 1.16.8 with Go 1.17? ``` $go version go version go1.17 linux/amd64 $go get golang.org/dl/go1.16.8 go get: installing executables with 'go get' in module mode is deprecated. Use 'go install pkg@version' instead. For more

Re: [go-nuts] Re: [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-10 Thread Jérôme LAFORGE
Thanks, that works. Le vendredi 10 septembre 2021 à 13:15:18 UTC+2, Ian Davis a écrit : > On Fri, 10 Sep 2021, at 11:11 AM, Jérôme LAFORGE wrote: > > Hello all, > For testing purpose, how can I install Go 1.16.8 with Go 1.17? > > ``` > $go version > go version go1.17

[go-nuts] Re: go list -u -m -json all

2021-08-04 Thread Jérôme LAFORGE
Go 1.17RC2 fixes this issue. Thanks all contributors. Le lundi 26 juillet 2021 à 09:11:53 UTC+2, Jérôme LAFORGE a écrit : > FYI, I just seen an issue has been already opened : > https://github.com/golang/go/issues/47377 > > Le dimanche 25 juillet 2021 à 21:02:29 UTC+2, Jérôme LAF

[go-nuts] test huge table driven

2021-10-05 Thread Jérôme LAFORGE
Hello, I want to know if someone has already think about to split automatically (by configuration with go test -split 50) a same test table driven (more specially when the table is huge e.g. > 300 and so it takes time to execute) into different test runs in order to split the run on each

Re: [go-nuts] test huge table driven

2021-10-06 Thread Jérôme LAFORGE
Have you tried to parallelize the tests? > > t.Run(tc.name, func(t *testing.T) { > t.Parallel() > // your test > }) > > > Best Regards, > Stephane > > On Tue, Oct 5, 2021 at 2:08 PM Jérôme LAFORGE > wrote: > >> Hello, >> I want to kn

Re: [go-nuts] test huge table driven

2021-10-06 Thread Jérôme LAFORGE
erratum: So we can't use it ... Le mercredi 6 octobre 2021 à 09:10:03 UTC+2, Jérôme LAFORGE a écrit : > Hi Stéphane, > Thanks for your suggestion, it works but unfortunately it raised several > data races as side effect. > As it doesn't run each test in separate process. >

[go-nuts] Re: Golang: http2 client immediately close connections via proxy while idleConn was enabled

2021-12-07 Thread Jérôme LAFORGE
nice issue number :) Le mardi 7 décembre 2021 à 05:54:13 UTC+1, zzk...@gmail.com a écrit : > I had opened an issue on the Golang repo, in case anyone interested. > > net/http2: client immediately close most of connections via forward proxy > even if idleConn was configured · Issue #5 ·

[go-nuts] go list -u -m -json all

2021-07-25 Thread Jérôme LAFORGE
Hello, I am currently testing `go1.17rc1 linux/amd64` in my dev env. With this version `go list -u -m -json all` seems not work anymore (I use it to know which module is outdated thanks to https://github.com/psampaz/go-mod-outdated#usage) I have this error even if I do `go mod tidy` before to

[go-nuts] Re: go list -u -m -json all

2021-07-25 Thread Jérôme LAFORGE
Unfortunately, it didn't help me. I ran `go mod download` before `go list -u -m -json all` without change. Le dimanche 25 juillet 2021 à 10:35:55 UTC+2, Tamás Gulácsi a écrit : > go mod download > helped me. > > jerome@gmail.com a következőt írta (2021. július 25., vasárnap, > 9:49:40

[go-nuts] Re: go list -u -m -json all

2021-07-26 Thread Jérôme LAFORGE
FYI, I just seen an issue has been already opened : https://github.com/golang/go/issues/47377 Le dimanche 25 juillet 2021 à 21:02:29 UTC+2, Jérôme LAFORGE a écrit : > Unfortunately, it didn't help me. > I ran `go mod download` before `go list -u -m -json all` without change. > > &

[go-nuts] Generics

2022-05-27 Thread Jérôme LAFORGE
Hello, I do some tests with generics with Go 1.18. But I can't reach my goal. With https://go.dev/play/p/7kxMEWtXcPG I have: ``` panic: json: Unmarshal(nil *main.payload) goroutine 1 [running]: main.main() /tmp/sandbox3884661607/prog.go:43 +0x112 Program exited. ``` Because payload

Re: [go-nuts] Generics

2022-05-28 Thread Jérôme LAFORGE
o.dev/play/p/YXOTLKpvXNI using json unmarshal > > > directly and without using binary marshaller. > > > > > > or even https://go.dev/play/p/GFE3rnyx9f8 without the endpoint > abstraction. > > > > > > or maybe explain what you want to achieve other t

[go-nuts] json encoder with large object (big bytes array)

2022-12-09 Thread Jérôme LAFORGE
Hello, I would like to know if there is elegant way to json encode very long field (with io.Reader)? For example: (play ground https://go.dev/play/p/QxlbNMy3ERK ) ``` func TestJSONStreamBytes(t *testing.T) { type MyStruct struct { Reader1 io.Reader `json:"field1"` Reader2

[go-nuts] fmt.Printf Go-syntax formated representation of the value

2023-04-28 Thread Jérôme LAFORGE
Hello, In my unit tests when expected is not the actual result, I like display actual value with Go-syntax. For example: if got != expected { t.Errorf(" %#v", got) // []string{"blah','blah"} } But it want to know if there is elegant way to display as formatted on multi-lines (a kind of

[go-nuts] xml parser get data

2023-11-28 Thread Jérôme LAFORGE
Hello, The playground: https://go.dev/play/p/EQTHwGlKQDt I have this xml data := []byte(` hello foobar `) That, I want to unmarhsall into xmlBody struct: type ( xml3 struct { Data string `xml:",innerxml"` } xmlBody struct { XML2 string `xml:"xml2"` XML3 xml3 `xml:"xml3"` } ) Unfortunately, I

[go-nuts] Re: xml parser get data

2023-11-29 Thread Jérôme LAFORGE
with fix when no xml3 tag : https://go.dev/play/p/DaW7z7woHeW Le mercredi 29 novembre 2023 à 10:03:23 UTC+1, Jérôme LAFORGE a écrit : > Thx Jason. > > If helps someone, plz find how I manage this: > https://go.dev/play/p/kLwRB3fuJdK > > > Le mercredi 29 novembre 2023 à 03

[go-nuts] Re: xml parser get data

2023-11-29 Thread Jérôme LAFORGE
ml parsing part, and then doing what you want with the > tree of tags. > > On Tuesday, November 28, 2023 at 3:00:18 PM UTC Jérôme LAFORGE wrote: > >> Hello, >> The playground: https://go.dev/play/p/EQTHwGlKQDt >> >> I have this xml >> data := []byte(`