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
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
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,
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
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,
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
>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
> 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
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.
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
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,
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
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
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
> 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.
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
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
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
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
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
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)
>>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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.
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
>
>
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
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 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
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
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
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.
>
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 ·
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
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
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.
>
>
&
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
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
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
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
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
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
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(`
71 matches
Mail list logo