|
I just started learning Go this last week and like it quite a bit. I'm hoping it can fill the wasteland void that we currently use Ruby for in a lot of places. There's a whole lot of conversations I have that go something like "Oh yeah, I wrote a script for that, just git clone the repo it's in and use it......well yeah, you have to do bundle install first to get the required gems...no bundler is a thing you have to install....got it? Great. Hmmm, it's still not working? What version of Ruby are you running? Ah, just point RVM at a new version....oh, you installed a system Ruby? gently caress. Well, try this Python thing instead, yeah, that won't work on RHEL 5.6 because Python is too old." I think any hit my productivity takes to learn my way around go will be made up for in that I won't be troubleshooting installs of Ruby/Python on other developer systems all goddamn day. Whelp, that's my story! I just wanted to say that as someone who is coming from a Python/C background, Go feels super duper natural and I like it a lot!
|
# ¿ Aug 27, 2015 22:08 |
|
|
# ¿ May 4, 2024 13:47 |
|
I'm reading some about how interfaces work here: http://www.golangbootcamp.com/book/interfaces and had a question about this. To save everyone from clicking on the link, it provides some example code like this: code:
e: sorry if this is a dumb question, it's just that everyone says "Start doing things the go way to learn better!" and I'm not exactly sure what the go way is in this case. Winkle-Daddy fucked around with this message at 22:18 on Aug 28, 2015 |
# ¿ Aug 28, 2015 22:11 |
|
Hmm, okay, but here:code:
|
# ¿ Aug 28, 2015 22:36 |
|
Oh duh. Okay. Thank you!
|
# ¿ Aug 28, 2015 22:47 |
|
I've learned a lot more about Go and like it quite a bit. But I ran into a weird thing that I'm having a hard time googling the 'correct' way to do it. Hopefully someone can help out. I have a struct that I want to use for reading/writing config files. My struct is like this:code:
code:
code:
code:
|
# ¿ Apr 7, 2016 16:29 |
|
Lonely Wolf posted:You're just using the wrong syntax for the composite literal, if I'm understanding the question: Oh! That makes perfect sense looking at it now. Heh. Thanks! This is what happens when you're coming from Python, I guess... COOL CORN posted:Does anyone use Go for game development? I'm curious what the most popular use cases of Go are at the moment - I guess mostly web-based? We have found that go is best used as part of your service oriented architecture stack. It's really easy to get individual go binaries deployed and controlled through systemd that do everything from host simple web services to doing more advanced manipulation. It's not very good for game dev, and UI libs aren't well supported like at all due to how big your binary becomes due to the static linking involved. Someone who has actually tried could probably elaborate more, but I see it as 90% replacing your bash magic glue in your tech stack. Winkle-Daddy fucked around with this message at 17:39 on Apr 7, 2016 |
# ¿ Apr 7, 2016 17:34 |
|
As someone coming from vim (albeit with a bunch of plug-ins) I must say that Atom is great. I've always thought that IDEA "feels" really sluggish (whatever that means, I feel the same about pyCharm, intellij, aptana, eclipse, etc), while Atom feels very snappy and unobtrusive. The only issue I've run into so far is that one of the plug-ins appears to eat my imports if I'm importing two different directories in the same Github repo. That's the sole issue I've run into so far, though. I also find that since my Go projects are not monolithic but tend to be more service oriented, a full IDE experience is probably not as helpful as it would be if I was working on a complex Python project or something.
|
# ¿ Apr 19, 2016 23:13 |
|
Uhhhhh, stupid question about how channels work and my Google-fu is failing me this afternoon. Let's say I'm creating a hypothetical data struct that's a bunch of hostnames/platforms. Now let's say I want to ping each of these once and just return a confirmation that a certain host was completed back to the main function. My first inclination is to do something like this: code:
This is just a stupid simple example to help me understand how these things work. In a real example I am quite certain my design would be significantly different. e: okay, the problem is slightly different than I thought. If I close the channel, then I can't receive on it anymore. If I remove the close, my output looks like: code:
Winkle-Daddy fucked around with this message at 22:35 on Jun 27, 2016 |
# ¿ Jun 27, 2016 22:17 |
|
so loving future posted:You're closing your channel before you read it. That was odd, I did: code:
code:
Dangerllama posted:If you're unsure about the number of things you're going to pass on the channel, you can also use a WaitGroup. Notice that the WaitGroup needs to live in its own goroutine in order to be able to close the channel: Thanks! I'll see if this is easier to work with next. I have a project where I'll need to spin off a large work load into various go routines and then organize them, so I'm just creating super small examples to help get my brain around how this all works.
|
# ¿ Jun 27, 2016 23:06 |
|
skul-gun posted:You might find these presentations/articles helpful, if you haven't seen them already: Thanks! These are really helpful and I should stop trying to learn from the language spec and standard library docs alone. Lonely Wolf posted:Missed the party, but you can just write Thanks for the tip! I thought it was silly you needed to use as bit bucket there if you didn't care about the iterator at all, now I know.
|
# ¿ Jun 28, 2016 16:04 |
|
Help! I'm fixing up some co-workers code. He needed to add some cross platform support to windows. It's laid out like this now: code:
code:
code:
e: this is highly simplified, the fuckening is great with this one :\ It's actually dozens and dozens of dupe functions
|
# ¿ Nov 16, 2016 19:08 |
|
e: ^^^ yeah, I removed _common.go to get my makefile to build, which now looks something like this:code:
Hmm, I think this may just be a linter thing, where it complains that functions in an OS specific file are undefined...because it does seem to build okay so long as no functions are re-declared between the common file and the OS specific file. Winkle-Daddy fucked around with this message at 19:37 on Nov 16, 2016 |
# ¿ Nov 16, 2016 19:34 |
|
|
# ¿ May 4, 2024 13:47 |
|
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:code:
|
# ¿ Nov 18, 2016 22:02 |