Re: [go-nuts] goxpath: An XPath 1.0 parser

2016-06-13 Thread Henrik Johansson
How does it compare to https://godoc.org/launchpad.net/xmlpath? I have been using it with great satisfaction but it is not complete to my knowledge xpath feature wise. mån 13 juni 2016 kl 01:48 skrev Chris Trenkamp : > https://github.com/ChrisTrenkamp/goxpath > > I've

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-22 Thread Henrik Johansson
Really? I find that counting digits in large numbers is harder, for me at least, than expected. The scientific notation is sweet. On Wed, Jun 22, 2016, 14:57 Manlio Perillo wrote: > Il giorno martedì 21 giugno 2016 18:35:13 UTC+2, Caleb Spare ha scritto: >> >> This was

Re: [go-nuts] Urlwatch

2016-06-25 Thread Henrik Johansson
Cache headers, etags etc and dynamic scheduling of re-fetch sounds useful. Why not start a little library? On Sat, Jun 25, 2016, 13:51 Johann Höchtl wrote: > > > Am Donnerstag, 23. Juni 2016 17:04:54 UTC+2 schrieb Shawn Milochik: >> >> What do you need it to do,

Re: [go-nuts] What dependency management tool do you use?

2016-07-12 Thread Henrik Johansson
I am unsure about pprof but running tests with race for example works great. I would guess that it works. On Tue, Jul 12, 2016, 16:41 Ian Davis <m...@iandavis.com> wrote: > On Tue, Jul 12, 2016, at 09:23 PM, Henrik Johansson wrote: > > I use gb. I like it a lot and I hav

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Henrik Johansson
y. If > I were authoring a library I'd definitely stick to the go tool chain given > that GB projects aren't go gettable. > > - Will > > On Sat, Jul 16, 2016 at 5:44 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: > >> Well they have issues too of

Re: [go-nuts] What dependency management tool do you use?

2016-07-16 Thread Henrik Johansson
For repeatable builds there are many ways and tools that work fine, Gb is not unique in this respect. I don't get why this should be a controversial topic however. It seems to be an issue only in the go community. In all the other languages (newer more modern anyway) it is considered a solved

Re: [go-nuts] Is there a reason go doesn't use the small string optomization

2017-02-01 Thread Henrik Johansson
Ok that clarifies it for me :) ons 1 feb. 2017 kl 15:29 skrev Ian Lance Taylor <i...@golang.org>: > On Tue, Jan 31, 2017 at 10:08 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > What makes strings harder than for example []byte? > > Sorry, I'm not sure

[go-nuts] XML unmarshal woes

2017-02-02 Thread Henrik Johansson
I have xml that looks like this: sadasd gfdfg ... ... Where a and be can appear in any order and this order needs to be preserved. I have managed to Marshal xml decently using a struct such as: type Holder { A A B A } type A string type B string using a MarshalXML method on the

Re: [go-nuts] Re: XML unmarshal woes

2017-02-02 Thread Henrik Johansson
Ahh fantastic thanks a lot! tors 2 feb. 2017 kl 15:11 skrev : > Here is a playground link: https://play.golang.org/p/_wJEBd1L9x > > ABStuff string `xml:",innerxml"` > > You can capture the innerxml with an appropriate tag; you can also, as my > third example in the above

Re: [go-nuts] storing transaction in context

2017-02-08 Thread Henrik Johansson
The Context as "a bag of stuff" is attractive since it makes your code easier to refactor (knock, knock) but gives me void* or as Jakob said map[string]interface{} vibes. I think I think it should be avoided but probably not unconditionally. I guess there can be cases where it makes sense. ons

Re: [go-nuts] Re: XML unmarshal woes

2017-02-03 Thread Henrik Johansson
I ended up using the excellent package https://github.com/clbanning/mxj by Charles Banning. Thanks a great bunch it really made my day much easier! tors 2 feb. 2017 kl 15:39 skrev Henrik Johansson <dahankz...@gmail.com>: > Ahh fantastic thanks a lot! > > tors 2 feb. 2017

Re: [go-nuts] how to write self-closing xml tags

2017-01-30 Thread Henrik Johansson
I am truly sorry for resurrecting this old thread but I found my self needing to emit xml containing: today and I am unsure how to deal with it. I have to do it for legacy reasons and there is very little leeway in what the clients can accept. It is also high volumes and no files are

Re: [go-nuts] Arguments for writing fast, high-load servers in Go instead of Scala?

2017-02-18 Thread Henrik Johansson
The cognitive difference is huge in Go's favor. Aside from that the new impressive gc results built for low latency can be a good argument. We have deployed a number of services in Go over the past months and are very happy with the performance. We used to do all these in Java but Go is easier to

Re: [go-nuts] Re: Understanding go routine heap

2016-08-21 Thread Henrik Johansson
Yes like Jan previously said. It is the very use case WaitGroup was developed for. On Sun, Aug 21, 2016, 15:45 T L wrote: > > > On Saturday, August 20, 2016 at 2:29:41 PM UTC+8, Yulrizka wrote: >> >> Dear gophers >> >> I have discussion with my colleague about this code >>

Re: [go-nuts] Re: the case for returning interface vs struct

2017-03-01 Thread Henrik Johansson
This comes down to encapsulation I guess. You may want to hide some internals and perhaps not other. Simple data types are probably fine but say that you have an interface Store then you can have redisStore or cassandraStore both implementing the same interface and the rest of your program just

Re: [go-nuts] Re: Glide for forks

2016-09-01 Thread Henrik Johansson
but it feels like cheating... On Fri, Sep 2, 2016, 00:51 Henrik Johansson <dahankz...@gmail.com> wrote: > I did try it but perhaps I did something wrong. > Is 'glide update' enough after such an addition? > > The cloned repo has a glide.yaml and lock file checked in so these would

Re: [go-nuts] Is there the incompatibility risk when using the XxxxPointer functions in sync/atomic package in later go versions?

2016-09-08 Thread Henrik Johansson
Or maybe it works the other way? Because sync/atomic is covered then by accidental extension so is unsafe. tors 8 sep. 2016 kl 15:00 skrev Jan Mercl <0xj...@gmail.com>: > On Thu, Sep 8, 2016 at 2:51 PM T L wrote: > > > Aren't the parameters of atomic.Load/Store/SwapPointer

Re: [go-nuts] What 5 things does Go need in 2017?

2016-09-12 Thread Henrik Johansson
Some distros suffer less from this. Arch is perfectly up2date in line with its rolling approach. I agree with Dave that a supported repo is very nice. It is not unusual for companies to lag behind even on LTS installs but still having a need for updates of a particular software. mån 12 sep.

Re: [go-nuts] Multiple-reader single-writer map access - is this lockless workaround safe?

2016-09-13 Thread Henrik Johansson
I think this will be an interesting read especially if you come from Java. https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/ On Tue, Sep 13, 2016, 19:08 sqweek E. wrote: > On Tuesday, September 13, 2016 at 10:57:47 PM UTC+8, Alan Donovan wrote: > >> On 13 September

Re: [go-nuts] Re: [ANN] A Go based map reduce system (second attempt)

2016-09-12 Thread Henrik Johansson
Perhaps something like this? https://github.com/pachyderm/chess mån 12 sep. 2016 kl 18:32 skrev David Crawshaw : > The map-reduce systems I've worked with in the past bundle up the map > and reduce functions in a binary, distribute it, and then communicate > with it by an

Re: [go-nuts] what's the difference between Golang and Java about interface?

2016-10-08 Thread Henrik Johansson
But that is just syntactic sugar around the fact that Java does not have first class functions. At least not in the sense Go does. On Sat, Oct 8, 2016, 17:31 Pietro Gagliardi wrote: > In Java, if an interface contains exactly one method, and that method is > not already

Re: [go-nuts] why this?

2016-09-28 Thread Henrik Johansson
>> >> On Thu, Sep 29, 2016 at 9:53 AM, T L <tapi...@gmail.com> wrote: >> >>> >>> >>> On Thursday, September 29, 2016 at 12:32:48 PM UTC+8, Henrik Johansson >>> wrote: >>>> >>>> This is just how type assertion works

Re: [go-nuts] why this?

2016-09-28 Thread Henrik Johansson
This is just how type assertion works. If you don't use the dual return it panics if the actual type is different from the one you try to assert. On Thu, Sep 29, 2016, 05:26 T L wrote: > package main > > func main() { > var m = map[string]int{} > _, _ = m["abc"] //

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread Henrik Johansson
I actually read through the thread and unless everyone in that thread got the same message then I Aram should not have gotten the note. I recognize the potential value of the CoC but it always boils down to opinions. Imho this was a bad call. Bad calls happen and we should be able to get past it

Re: [go-nuts] JSON with repeating section and Slice in struct

2016-10-30 Thread Henrik Johansson
You also have to name the fields using struct tags to match the actual json field names. On Sun, Oct 30, 2016, 12:28 Pietro Gagliardi wrote: > You need to export the fields of tData in order for encoding/json to see > them. > > On Oct 30, 2016, at 6:01 AM, MaReK Olšavský

Re: [go-nuts] Concurrency and order of execution

2016-11-10 Thread Henrik Johansson
Also what makes you think that ordering is mandated? Any of the goroutines can be scheduled to run. The odds of 1 running first seems intuitively higher but the should be nothing stopping the last to run first. On Fri, Nov 11, 2016, 07:11 Henrik Johansson <dahankz...@gmail.com> wrote: >

Re: [go-nuts] Concurrency and order of execution

2016-11-10 Thread Henrik Johansson
I think there is a race on the WaitGroup. Add all of them before the loop. It might not matter for what you are seeing but anyway. What happens with an unbuffered channel? On Fri, Nov 11, 2016, 07:08 wrote: > Hello, > > I've written a small program to demonstrate what I

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread Henrik Johansson
know for sure, but I imagine that Russ’ statement about > >> atomics was mainly concerning synchronization – which Go’s > >> sync/atomic operations provide. And I would certainly agree. > > > > I surely maybe completely wrong in interpreting what Henrik Johansson >

Re: [go-nuts] allow {3}, {true} etc

2016-10-24 Thread Henrik Johansson
I agree with Nate. The consistency in typing is a very compelling argument. On Mon, Oct 24, 2016, 22:14 Nate Finch wrote: > Because it's consistent with how you get a pointer for other types... if > I'm used to using {x} for structs, maps, and slices, then it's perfectly >

Re: [go-nuts] issue with sending JSON via HTTP

2016-10-25 Thread Henrik Johansson
It seems like you encode the valid json string? If you have a string that is json you should be able to post the string as is no? Just make sure you set the application/json content type. tis 25 okt. 2016 kl 14:32 skrev Rich : > Hi All, > > I have code that is similar to this:

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Henrik Johansson
The confusion I have had is rather with nilability. A channel can be nil even though it is not explicitly a pointer. The whole "call by reference" debate is fun but usually with beer... fre 21 okt. 2016 kl 15:39 skrev Ian Lance Taylor : > On Thu, Oct 20, 2016 at 10:47 PM, T L

Re: [go-nuts] Re: There has no Mutex.Trylock() implemention or similar method ?

2016-10-21 Thread Henrik Johansson
There was a long thread just recently about SpinLocks and the memory model. There are several implementations on github. I cannot vouch for the quality of any of them. fre 21 okt. 2016 kl 16:14 skrev Roberto Zanotto : > Maybe you can solve this with atomics. > You keep an

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Henrik Johansson
org>: > On Fri, Oct 21, 2016 at 6:52 AM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > The confusion I have had is rather with nilability. > > A channel can be nil even though it is not explicitly a pointer. > > It's a basic design decision in

Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Henrik Johansson
Relax, it was a primarily personal statement from Brad and he wanted to to see if it was shared by others. I am more baffled that not everyone agrees with him but that again is a personal view... fre 25 nov. 2016 kl 15:41 skrev : > It is not up to the Go team to decide

Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-24 Thread Henrik Johansson
Seriously if the community is really a community then it will pop up in another form. If not then it was never really a community to begin with. I agree with Brad that this isn't something I want to condone. In fact if people stopped using services with mgmt like this more often then crap like

Re: [go-nuts] Re: Memcached replacement in GO!

2016-11-16 Thread Henrik Johansson
Groupcache is really cool but for mutable data it requires some hoops to be useable. ons 16 nov. 2016 kl 20:50 skrev Tamás Gulácsi : > > > 2016. november 16., szerda 15:10:30 UTC+1 időpontban Slawomir Pryczek a > következőt írta: > > Hi Guys, I wrote memcached like

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-28 Thread Henrik Johansson
ing email was an unwarranted, > disproportioned response. I'm just trying to understand where the > strawmans/tangents (or what I perceive as, willing to be corrected) are > coming from. And I didn't list all. > > Surgical arguments > narratives. > > > On 29/10/16 01:31, Henrik Jo

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-28 Thread Henrik Johansson
The problem isn't the CoC or that the group it responded to a complaint but that it right away started with a very aggressive warning email. Why not talk to Aram like human being explaining the situation. This would have given him a chance to resolve it on his own. Seems like a much simpler and

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread Henrik Johansson
To me the wording with a warning in it sounds extremely harsh. Adding any number of pleases only makes it worse. I still think this should not have been acted upon at all. What sort of de facto empirical outcome has there been previously? Are there any previous incidents that have not gone public?

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-11 Thread Henrik Johansson
But do these types of spin locks provide the same memory effects as standard locks? I get that only one goroutine at a time can run the given block but assigning to shared vars inside the block will still need to use the methods from sync/atomic right? On Tue, Oct 11, 2016, 22:47

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-11 Thread Henrik Johansson
n absolute must, your go routines will sit there spinning in > the infinite loop until some other routine unlocks which is going to cost > CPU. > > > On Tuesday, October 11, 2016 at 11:20:15 PM UTC-5, Henrik Johansson wrote: > > But do these types of spin locks provide the s

Fwd: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread Henrik Johansson
Forgot the list, sorry. -- Forwarded message - From: Henrik Johansson <dahankz...@gmail.com> Date: ons 12 okt. 2016 kl 08:32 Subject: Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread Henrik Johansson
red vars using atomic load > (atomic.Value for example) or something similar? > > > > Not if everyone accessing them is using a mutex to synchronize the access. > > > > John > > John Souvestre - New Orleans LA > > > > *From:* golang-nuts@googlegroups.com

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread Henrik Johansson
ight find that a regular sync/Mutex does as well or better. The fast path > (when there’s little congestion) isn’t much more than a CAS. > > > > John > > John Souvestre - New Orleans LA > > > > *From:* Henrik Johansson [mailto:dahankz...@gmail.com] > *Sent:* 20

Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread Henrik Johansson
other goroutine from doing an atomic operation, for example. So > mixing the two could be disastrous. But there are some cases where it can > be done. > > > > John > > John Souvestre - New Orleans LA > > > > *From:* Henrik Johansson [mailto:dahankz...@gmail.com] >

Re: [go-nuts] Re: what's the difference between Golang and Java about interface?

2016-10-10 Thread Henrik Johansson
Yet a notable such marker interface Serializable is known by almost all Java developers ;) On Tue, Oct 11, 2016, 02:04 wrote: > An interesting aside about Java Interfaces that most people don't know is > that you can have an empty Interface without methods or members and

Re: [go-nuts] Re: How do you mitigate against nil pointer dereference

2017-01-13 Thread Henrik Johansson
Expose properties as methods and do the check in the method can make the caller use easier. On Fri, Jan 13, 2017, 14:41 wrote: > Hi, > > some simple leads, > > Use one line initialization of Person > p := {Attr:{}} > > Enhance the if conditions statement > if p.Attr !=

Re: [go-nuts] Using Go in a locked down SOC2 environment (dependency management hell)

2017-01-06 Thread Henrik Johansson
I would go with vendoring and proper education combined with peer review. The hoops you go through to maintain "control" seems awkward at best. I mean, you do after all trust the developers with you production code... On Fri, Jan 6, 2017, 20:16 Jacek Furmankiewicz wrote: > I

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread Henrik Johansson
For us they interact exclusively through either plain http based services or via Nats, no other interactions take place. It works as expected without any particular issues. I would suggest that you start with a similar approach and create a self contained little service to show that Go not only

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-20 Thread Henrik Johansson
For us it started with me rewriting a small service. It was done quickly and with great performance which led to curiosity from other developers which in turn led to a larger system of services being built in Go with great results. The initial usual fears about knowledge and "risks" was quickly

Re: [go-nuts] Generics are overrated.

2017-07-31 Thread Henrik Johansson
I don't miss Javas generics so much for the ability to create generic libraries but for using them. Things like map, group, filtering etc is so much simpler to write (maybe not always read). And it is fine to loop explicitly by hand coding but with grouping and perhaps several levels of filtering

Re: [go-nuts] Re: Go one-line installer

2017-08-02 Thread Henrik Johansson
At home on my Arch i really prefer pacman for everything and only as a last resort do I ever exec any curlable installer. The problem is usually that they don't get properly updated and the packagemanager anyway pulls in Go since it is a dependency for something else and it is a mess with two or

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-02 Thread Henrik Johansson
How should I know when it is safe to omit using locks? What I have drilled into my head is "yes you not only need a lock but every read of shared data has to have a corresponding write that uses a lock". Lock meaning anything that results in the proper memory effects. I can sort of get that this

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Henrik Johansson
But isn't this what is happening in the example? Or is write-only not sharing? On Thu, 3 Aug 2017, 09:23 Dave Cheney, <d...@cheney.net> wrote: > IMO you need a lock whenever you are sharing a value between goroutines by > storing it in memory. > > On Thu, 3 Aug 2017, 17:2

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Henrik Johansson
appens before relationship between reader and writer. >> >> On Thu, 3 Aug 2017, 17:33 Henrik Johansson <dahankz...@gmail.com> wrote: >> >>> But isn't this what is happening in the example? Or is write-only not >>> sharing? >>> >>> On Thu,

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Henrik Johansson
I think I am mostly after a mental pattern to easily recognise when synchronizations are needed. I am decently good at this but I tend to be very conservative and use locks and atomics perhaps when they are not needed. But here we have several goroutines all taking part in the initialisation

Re: [go-nuts] lock for assigning to different elements of an array

2017-08-03 Thread Henrik Johansson
It does help, thank you Konstantin. tors 3 aug. 2017 kl 10:25 skrev Konstantin Khomoutov <kos...@bswap.ru>: > On Thu, Aug 03, 2017 at 07:21:24AM +0000, Henrik Johansson wrote: > > [...] > > It gets hypothetical pretty quick and usually when this happens I make > sure &

Re: [go-nuts] How to optimize as with -O2 from Gcc? (50x speedup)

2017-08-04 Thread Henrik Johansson
Actually I get the same as the original program on my mac. time ./ccode sum=606329794183272.375000 ./ccode 0.17s user 0.00s system 98% cpu 0.170 total The Go version -O2 -Wall time ./pow sum=6.063297941832724e+14./pow 5.47s user 0.01s system 99% cpu 5.490 total fre 4 aug. 2017 kl 09:38

Re: [go-nuts] How to optimize as with -O2 from Gcc? (50x speedup)

2017-08-04 Thread Henrik Johansson
c-code-sum_CLANG -lm > time ./c-code-sum_CLANG > res = 6.0633e+14 > > real 0m0.157s > user 0m0.156s > sys 0m0.004s > > So the question might be: what is CLANG doing? (and how to do this with > Go?...) > > > On Friday, August 4, 2017 at 6:04:01 PM UTC+10, Sebastien Binet

Re: [go-nuts] How to optimize as with -O2 from Gcc? (50x speedup)

2017-08-04 Thread Henrik Johansson
Ah of course that explains it. On Fri, 4 Aug 2017, 11:22 Dave Cheney, wrote: > Gcc on OS X is an alias for clang as Apple does not ship any GPLv3 > software with their os. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group.

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

2017-08-10 Thread Henrik Johansson
I beg to differ. Most Java apps I have seen over many years almost unanimously suffer from over-modeling. That Go encourages another style of modeling does not make it too simple. It only makes it different which may be good or bad according to taste. That said, I personally think that generics

Re: [go-nuts] godoc.or is unreachable from Germany

2017-08-11 Thread Henrik Johansson
Not just there. I got internal server error. On Fri, 11 Aug 2017, 11:47 Norbert Fuhs, wrote: > Hi, > > it seems https://godoc.org/ is unreachable from Germany. > > Its also noted on Go Forums: > https://forum.golangbridge.org/t/godoc-org-is-down/6265 > > > -- > You

Re: [go-nuts] Built-in log Package

2017-08-17 Thread Henrik Johansson
Sorry to but in but what happened to the whole logging initiative that was on going? Did I miss something about that? It seems very related to this. tors 17 aug. 2017 kl 09:10 skrev dc0d : > As they say global variables/things are bad. But I even use a global >

Re: [go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-09 Thread Henrik Johansson
I agree a typed concurrent map would be very neat but each type that make has to support requires AFAIK specialisation in the compiler(?) which seems to be burdensome. Perhaps backwards compatibility prohibits the use of the name 'cmap', not sure. mån 10 juli 2017 kl 05:23 skrev

Re: [go-nuts] Going places

2017-07-21 Thread Henrik Johansson
I am feeling slightly ambivalent but cool and congrats! fre 21 juli 2017 kl 18:02 skrev Michael Jones : > Maybe not news, and certainly not big news, but I just filed a patent that > uses Go source code to illustrate logical methods claimed in the invention. > So if it

Re: [go-nuts] go get and protos (protoc; grpc)

2017-07-28 Thread Henrik Johansson
The consensus seems to be to generate and checking artefacts such as this. It does help with reproducibility and doesn't force the enduser to install all kinds of possibly weird tools. fre 28 juli 2017 kl 20:46 skrev 'Laurent Demailly' via golang-nuts < golang-nuts@googlegroups.com>: > This

Re: [go-nuts] Repository of self-contained functions

2017-08-09 Thread Henrik Johansson
https://i.redd.it/tfugj4n3l6ez.png I am sorry, I couldn't help it! ons 9 aug. 2017 kl 08:40 skrev Jakob Borg : > On 7 Aug 2017, at 16:38, Lukas Senger wrote: > > > > Basically the idea is to > > encourage writing and sharing simple self-contained

Re: [go-nuts] Re: HTTP/2 multiplexing

2017-08-03 Thread Henrik Johansson
Out of curiosity do you do something like this in wireshark? ip.dst_host=="duckduckgo.com" && tcp.flags.syn == 0 My wireshark fu is really weak... tors 3 aug. 2017 kl 11:35 skrev : > Works, thanks a lot!!! > Also found this related discussion: >

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-22 Thread Henrik Johansson
I may suffer from a "fundamental lack of understanding" about many things but there isn't much to misunderstand in Russ blog post. I have also seen the talk. I simply disagree wrt generics. I appreciate that he has thought a lot about it and needs more feedback to feel it worth continuing. I

Re: [go-nuts] Next generation code generator for go

2017-08-23 Thread Henrik Johansson
For all vscode users there is https://github.com/Microsoft/vscode-go/issues/1160 to maybe vote for to get editor support. ons 23 aug. 2017 kl 10:57 skrev Walter Schulze : > Thanks, that is good to know :) > If you do, please let me know. > It would be nice to add more

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-23 Thread Henrik Johansson
ons 23 aug. 2017 kl 08:37 skrev Florin Pățan <florinpa...@gmail.com>: > On Wednesday, August 23, 2017 at 6:45:57 AM UTC+1, Henrik Johansson wrote: > > I may suffer from a "fundamental lack of understanding" about many > things but there isn't much to misunderstand in

Re: [go-nuts] Built-in log Package

2017-08-17 Thread Henrik Johansson
wrote: > On Thursday, August 17, 2017 at 3:14:09 AM UTC-4, Henrik Johansson wrote: >> >> Sorry to but in but what happened to the whole logging initiative that >> was on going? >> Did I miss something about that? It seems very related to this. >> > > That

Re: [go-nuts] Re: adding context.Context to new code

2017-05-12 Thread Henrik Johansson
With the whole "Reactive" movement thread locals have started to vanish at least in the Java ecosystem. I agree with Sameer that, while convenient, it comes with a whole set of obscure bugs. On Fri, May 12, 2017, 14:57 Sameer Ajmani wrote: > Hmm, I'm not finding good

Re: [go-nuts] Create methods for structs at runtime

2017-06-20 Thread Henrik Johansson
I think perhaps http://www.grpc.io/ can help if you want remoting but perhaps it will also give you too much bootstrap. tis 20 juni 2017 kl 22:00 skrev Ian Lance Taylor : > On Mon, Jun 19, 2017 at 8:38 PM, Dat Huynh wrote: > > > > On Tuesday, June 20, 2017

Re: [go-nuts] Re: To panic or not to panic, that's the question

2017-05-31 Thread Henrik Johansson
Yes those I also use in init sometimes but then you are in control of your templates and regexes and things usually blow up quickly during development which makes you fix it promptly. It is not quite the same though as I understood Peters question to be. The analogy would be the html/template to

Re: [go-nuts] To panic or not to panic, that's the question

2017-05-31 Thread Henrik Johansson
Init seems very harsh, how can you ensure proper configuration then? Otherwise I don't mind oanics during object creation or explicit initialization. Panics in mid execution less so but parhaps there are cases where it is warranted. ons 31 maj 2017 kl 21:25 skrev Peter Kleiweg

Re: [go-nuts] Re: Go 1.9 Beta 1 is released

2017-06-15 Thread Henrik Johansson
I must have missed this but just clarify my thoughts are all file reads async now? That would a pretty big deal for apps that read a lot of files. tors 15 juni 2017 kl 19:30 skrev Ian Lance Taylor : > On Thu, Jun 15, 2017 at 7:37 AM, wrote: > > > > With

Re: [go-nuts] Re: Go 1.9 Beta 1 is released

2017-06-15 Thread Henrik Johansson
Ah well. Still cool though! On Thu, 15 Jun 2017, 22:12 Ian Lance Taylor, <i...@golang.org> wrote: > On Thu, Jun 15, 2017 at 12:16 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > > > I must have missed this but just clarify my thoughts are all file r

Re: [go-nuts] Do you check in vendor packages?

2017-09-15 Thread Henrik Johansson
I always check in. It is super nice to not have to download separately and have one transitive dep destroy everything when you need it the least. On Fri, 15 Sep 2017, 02:37 Kevin Malachowski wrote: > I generally vote for checking in, or at least ensuring that /something/

Re: [go-nuts] Magefiles - a makefile replacement using go

2017-09-23 Thread Henrik Johansson
I just have a case where I was wondering if a Makefile could be the answer. Ill try mage instead and see what it can do! lör 23 sep. 2017 kl 07:11 skrev snmed : > Hi Nate > > Awesome, i never liked make files and fortunately i could use npm scripts > to build front and

Re: [go-nuts] Re: Choosing a framework

2017-09-10 Thread Henrik Johansson
Maybe it is better nowadays but at least last time I tried a bigger framework the first thing that happened was I had to either change logger or wrestle with how the framework did it's logging. I would from experience in both Go and other languages (mostly Java, Spring is not your friend) very

Re: [go-nuts] Re: Do you guys use ORMs when working with SQL?

2017-09-10 Thread Henrik Johansson
The switching of databases can happen but I have always solved it at a higher "service" level. What ORM's help you with is quickly getting started and it can in some cases help you with type safety. In the (not so) long run only the second matter and personally I wish there was something like

Re: [go-nuts] error handling needs syntactical sugar

2017-09-05 Thread Henrik Johansson
I think Rob is really on to something here and I have seen it evolve in my own programming. I tend to make simple things "flatter" and model things around cores that don't error out and just at the boundaries evaluate and possibly produce an error. Is that "monadic"? Anyway it gets easier if you

Re: [go-nuts] Re: Proposal: Just Use GitHub

2017-09-24 Thread Henrik Johansson
I am sorry but this type of straw man is not what Nate and others are arguing for. Never has anyone suggested we sacrifice quality for quantity but rather that more better than less to turn the old adage around. If code review can be done efficiently enough and by enough people then more

Re: [go-nuts] Rewriting a realtime game server from Node.js to Golang

2017-10-01 Thread Henrik Johansson
No not at all. If you can write a game engine in any language you should be fine just try to avoid too big design decisions too early so that once you get a better grasp of Go you can more easily refactor. mån 2 okt. 2017 kl 06:13 skrev Aaron : > Hi I am in a process of

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-22 Thread Henrik Johansson
ll this is not about generics but how what goes into Go 2. On Tue, 22 Aug 2017, 11:17 Egon <egonel...@gmail.com> wrote: > On Tuesday, 22 August 2017 10:56:52 UTC+3, Henrik Johansson wrote: >> >> I am sorry but you are missing the point. I think there already is a lot >>

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-22 Thread Henrik Johansson
You are right that there is a benefit analysis to be made. I just think the problems are more known than you do. On Tue, 22 Aug 2017, 12:08 Egon <egonel...@gmail.com> wrote: > On Tuesday, 22 August 2017 12:49:14 UTC+3, Henrik Johansson wrote: > >> The siphoning and "ta

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-22 Thread Henrik Johansson
rch then I strongly disagree with the approach. tis 22 aug. 2017 kl 09:12 skrev Egon <egonel...@gmail.com>: > On Tuesday, 22 August 2017 09:12:45 UTC+3, Henrik Johansson wrote: >> >> I am sorry Dave but you can ignore the needs of the many few as much as >> you w

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-22 Thread Henrik Johansson
I am sorry Dave but you can ignore the needs of the many few as much as you want but the tiny things won't go away. There probably won't be any _written_ experience reports for most of the little things. The things that people live through and sometimes just have the time to email the list about

Re: [go-nuts] Go 2 suggestion - Types like "int?"

2017-08-21 Thread Henrik Johansson
that may > have optional fields present? > > If the second then surely it's a case of use protobuf/gob/the standard > library? > If it's the first then I guess it's a tradeoff between language complexity > and laziness? > > Regards > > On Monday, 21 August 2017 14:

Re: [go-nuts] Go 2 suggestion - Types like "int?"

2017-08-21 Thread Henrik Johansson
I understand the the issue you are having. We had the same where we differentiate between absent string and empty string. It was messy with data from json but it worked. I think "int?", Optional or Maybe are not as helpful in Go as they can be in Java or perhaps C# since a small type with custom

Re: [go-nuts] Should we stop using a global logger?

2017-08-25 Thread Henrik Johansson
kl 11:14 skrev Peter Mogensen <a...@one.com>: > > > On 2017-08-25 10:45, Henrik Johansson wrote: > > Me neither but it can be very neat occasionally. > > > > Agreed and it also applies fine things like Tracing. > > But logger? If you change logger implem

Re: [go-nuts] Re: Generics and readability

2017-08-28 Thread Henrik Johansson
I don't know I have met many a newbie from university who didn't know their way around the Java world but would happily work with Haskell because their advanced courses used it. On Mon, 28 Aug 2017, 12:30 Wojciech S. Czarnecki wrote: > On Sun, 27 Aug 2017 17:28:07 + >

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-24 Thread Henrik Johansson
ur patience and calm in what spun away needlessly. On Thu, 24 Aug 2017, 00:14 Ian Lance Taylor <i...@golang.org> wrote: > On Wed, Aug 23, 2017 at 1:30 AM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > > > Sure, I am a bit short in this but again my opinion is

Re: [go-nuts] Re: Generics and readability

2017-08-25 Thread Henrik Johansson
Ah yes unfortunate that Ians proposal was rejected. fre 25 aug. 2017 kl 10:39 skrev 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com>: > Maybe a loaded question but what is the goal of this thread? Is it to > establish whether or not generics impact readability? In that case it >

Re: [go-nuts] Should we stop using a global logger?

2017-08-25 Thread Henrik Johansson
How do you code for storing a logger in context.Value? The same usual issues with lacking a shared logger interface happens or did I miss something neat? On Fri, 25 Aug 2017, 08:26 Peter Mogensen wrote: > > > On 2017-08-25 05:38, buchanae.o...@gmail.com wrote: > > - We create a

Re: [go-nuts] Should we stop using a global logger?

2017-08-25 Thread Henrik Johansson
interface for logging. There was some promising work alas no consensus afaik. fre 25 aug. 2017 kl 08:47 skrev Peter Mogensen <a...@one.com>: > > > On 2017-08-25 08:31, Henrik Johansson wrote: > > How do you code for storing a logger in context.Value? The same usual > > i

Re: [go-nuts] Gathering Ideas for Go 2.

2017-08-21 Thread Henrik Johansson
No but generally I would say that _everything_ is better today than lets say fifty years ago. Maybe every step wasn't better than the one immediately before but many steps later it surely is. If there was a way to easily test language features as just pulling in the golango.org/x libs then this

Re: [go-nuts] Re: Gathering Ideas for Go 2.

2017-08-21 Thread Henrik Johansson
Experience reports are very valuable but there are many things that are hardly possible to formulate as "something that hurt and needs to be fixed". For example the dreaded generics, it doesn't hurt much but I think that, for me, it is more that I am so happy with Go in general that I sort of

Re: [go-nuts] Running Go binary on a 56 core VM

2017-08-31 Thread Henrik Johansson
Try it out! It would be great if the scheduler and garbage collector could be so good as to making such tricks unnecessary. On Thu, 31 Aug 2017, 15:59 wrote: > Hi Guys, > > So, we wrote a Go service which does some heavy network IO over ZMQ (using > cgo calls). > > Now, we

  1   2   >