|
Voted Worst Mom posted:It doesn't matter what gofmt does because it does it consistently and that's the point. There are some bugs but that's not one of them. Yeah, caring about how gofmt is formatting your poo poo indicates you don't understand how great gofmt is. I have been writing a bit of golang recently, and I find it decently enjoyable. For the most part I can appreciate the language for what it is and isn't, it fills a like-C-but-not niche pretty well. I will bandwagon missing generics though, having to use (literally) the exact same code in 3 spots because I'm doing the same thing to 3 maps with a different value type is shameful (though map[string]interface{} is an even worse solution).
|
# ¿ Apr 20, 2015 02:29 |
|
|
# ¿ May 4, 2024 16:36 |
|
Deus Rex posted:That's not a very strong argument. If gofmt formatted each of your files into a single line, would you still feel that way? Sure, my point is simply that it Just Works and is Pretty Good and why the hell does anybody feel like bikeshedding the smooshing of x*x. Tangential hilarity, re: someone asking for map/filter: https://groups.google.com/forum/#!msg/golang-nuts/RKymTuSCHS0/MylwD97xYqUJ posted:The modern programmer thinks a newline is a thousand times harder to https://groups.google.com/d/msg/golang-nuts/RKymTuSCHS0/BXbkvn3ckOkJ posted:I would say the Go designers are frightened of newlines. In particular the one in front of the hanging brace.
|
# ¿ Apr 20, 2015 03:41 |
|
Go is really good for infrastructure stuff. We write and use a ton of tooling in Go both stuff we've written (logging, config mgmt, virtualenv fuckery, load balancing) and OSS like etcd, terraform, etc. Anybody that's spent much time with our Go code really starts to loathe the hundreds of thousands of lines of python we have. As our team has grown we get bit more and more by bullshit that comes out of bigger teams mixed with weak types, no compilation, etc. Not to mention we end up CPU bound in a ton of places. Go rulez basically.
|
# ¿ Mar 9, 2016 00:41 |
|
Mr. Crow posted:How are the analytics libraries for go these days? Anything similar to pandas in Python? Yeah, pretty good example of thing that is probably awful in golang. Stick to pandas :/
|
# ¿ May 18, 2016 02:36 |
|
Winkle-Daddy posted:Uhhhhh, stupid question about how channels work and my Google-fu is failing me this afternoon. You're closing your channel before you read it. You probably want to do something like this: code:
|
# ¿ Jun 27, 2016 22:40 |
|
Go rules so hard there's not much to say about it. Way more like a reimagined C than Java though. That it's GC'd is a red herring, outside of specific niches GC shouldn't be a thing devs should worry about. So vendoring is first class now, which rules hard. I got 99 problems but dependencies are never one. What do y'all think of glide vs godep vs? I've mostly used godep, but think it will probably be glide soon.
|
# ¿ Oct 8, 2016 19:19 |
|
https://dave.cheney.net/2013/10/12/how-to-use-conditional-compilation-with-the-go-build-tool You can use `// +build linux` to control which files are built, or just use `_<os>.go` filename suffix. The below works fine with `go build` for example. main.go code:
code:
code:
Mao Zedong Thot fucked around with this message at 19:26 on Nov 16, 2016 |
# ¿ Nov 16, 2016 19:24 |
|
Winkle-Daddy posted:So...doing things this way seems to have broken my ability to run automated tests. If I build, and provide as args every file I want to include it works fine. If I try to use build tags to control how things build I get the following error: My example builds fine with `go build .` -- it picks up `main_<os>.go` functions. You have networking.go/networking_<os>.go? Try removing the build tags maybe? Or if you can provide a reproducible example via gist or something I can poke at it.
|
# ¿ Nov 18, 2016 22:10 |
|
.............
Mao Zedong Thot fucked around with this message at 17:56 on Jun 27, 2017 |
# ¿ Apr 19, 2017 17:36 |
|
MALE SHOEGAZE posted:in my experience, lamdas / microservices are a function that maps simple problems to complex distributed systems problems
|
# ¿ Feb 27, 2018 16:35 |
|
Dangerllama posted:^^ a good post. Vendoring has worked really well for like multiple years. Go's biggest mistake was showing people `go get` without bashing into their head that it's not how you actually do anything besides "randomly install some cool thing to run".
|
# ¿ Aug 6, 2018 01:30 |
|
Check out https://github.com/mitchellh/mapstructure You still have to traipse your way through an unknown structure, but mapstructure makes it a bit nicer to do.
|
# ¿ Nov 5, 2018 17:54 |
|
|
# ¿ May 4, 2024 16:36 |
|
ErIog posted:I have a dumb question, but why would you care about the specific pointer to the function? You have tests. Go has idioms for testing you can use to test your stuff. So if those tests are good and they passed, what does testing the pointer get you? You could also just run the godoc server internally
|
# ¿ Dec 14, 2018 17:58 |