HNHacker News
TopNewBestAskShowJobs

zalmoxes

1,251 karma · joined January 9, 2014

I write everything with Go, and learning Elm. https://groob.io/
submissionscomments
zalmoxes··on Simplify Lets Encrypt Certificates Management for Kubernetes
I've been using this project on GKE for ~2 weeks now in combination with the nginx ingress controller. I have it configured to use the DNS challenge to get new certs so I don't have to expose an extra port as well.

It feels liberating to just get an SSL cert for any subdomain I need and have the whole process abstracted from me.

zalmoxes··on Test-Driven Development of Go Web Applications with Gin
:(

There are much better ways of doing it.

zalmoxes··on Test-Driven Development of Go Web Applications with Gin
I don't think it would be fair to say that the Go community optimizes for productivity over good software development practices. In fact, there's been a good push in the community lately to talk about application design and what it means for code to be good/not good.

* https://github.com/marcusolsson/gouk16-slides/blob/master/bu...

* https://peter.bourgon.org/go-best-practices-2016/

* http://dave.cheney.net/2016/08/20/solid-go-design

However, as a Go developer I'm finding that a lot of examples/tutorials and github projects are taking shortcuts when it comes to program design and how dependencies(loggers, config, db handlers) are being passed around. https://peter.bourgon.org/go-best-practices-2016/#program-de... IMO it's a sign of Go still being a relatively new language. Despite the language existing for ~6 years now, we're only discovering some best practices today.

zalmoxes··on Test-Driven Development of Go Web Applications with Gin
I wish Go examples/tutorials would stop showing code that uses or implies global state. Many of the beginner tutorials do, and as a result a lot of libraries and projects out there are also full of global state.
zalmoxes··on GoDoc: package letsencrypt
Also see https://godoc.org/golang.org/x/crypto/acme and https://github.com/xenolf/lego

Go has some of the best letsencrypt tooling out there, and there was even some support for merging ACME support directly into net/http https://github.com/golang/go/issues/17053

zalmoxes··on Golang landmines
This is mentioned in the Effective Go document.
zalmoxes··on Having fun with Go's nil, interfaces and errors
Francesc Campoy covers nil across all language types in Go https://www.youtube.com/watch?v=ynoY2xz-F8s
zalmoxes··on Show HN: dingo - a Google DNS-over-HTTPS caching proxy in Go
Thats a great point. As a Go developer I always try to make sure that there's a linux and binary for my small projects released on github. I'm surprised more Go devs don't do this. The toolchain makes it very easy to update releases. You can also use ldflags to set the current git revision and branch into the project.

Here's an example release.sh I have in most of my projects https://github.com/micromdm/scep/blob/master/cmd/scepclient/...

zalmoxes··on Golang concepts from an OOP point of view
That really depends on what you're tying to do. Say you have a Datastore interface, which has some methods like "Create", "Update", "Delete", and a MySQL + an inmem implementation.

You can have `datastore.New() Datastore`, which returns one of the implementations, or you can have `datastore.NewMySQLStore, datastore.NewInMemStore()`. Now you need a different method for each implementation.

Also be careful with returning concrete type, you can run into this issue: https://play.golang.org/p/WHAW1X6elS

zalmoxes··on Dependency graphs of Go web frameworks
r/golang discussion:

https://www.reddit.com/r/golang/comments/50uni1/dependency_g...

Also relevant: https://talks.godoc.org/github.com/broady/talks/web-framewor...

zalmoxes··on Linux.Rex.1 – A multifunctional self-replicating Trojan for Linux written in Go
Some of the same things that make Go an amazing language for legitimate use, also make it good for writing malwwre. This isn't the first time I see Go get used in such a fashion.
zalmoxes··on Shape of errors to come
Inspired by Elm?
zalmoxes··on Seymour Papert has died
Anyone interested in educational technology should read Mindstorms and Powerful Ideas. Papert described how technology should be used in schools and also predicted most issues and trends with education today.

Papert work is also present in most educational/programming toys we see today - Scratch, Kibo http://kinderlabrobotics.com/kibo/, LittleBits, LEGO Mindstorms all owe their roots to Paperts ideas.

http://worrydream.com/MeanwhileAtCodeOrg/

zalmoxes··on Bringing HSTS to www.google.com
Google has changed this almost a year ago

> Turn on SafeSearch VIP To force SafeSearch for your network, you’ll need to update your DNS configuration. Set the DNS entry for www.google.com (and any other Google ccTLD country subdomains your users may use) to be a CNAME for forcesafesearch.google.com.

>We will serve SafeSearch Search and Image Search results for requests that we receive on this VIP.

You can enforce safe search over https now https://support.google.com/websearch/answer/186669?hl=en

zalmoxes··on Go Packaging Proposal Process
Sam Boyer, one of the other people in the document wrote a nice article that dives into the complexity of dependency management.

https://medium.com/@sdboyer/so-you-want-to-write-a-package-m...

Discussion https://news.ycombinator.com/item?id=11088125

Sam is currently working on a library for Go https://github.com/sdboyer/gps

zalmoxes··on Httpoxy – A CGI application vulnerability
https://groups.google.com/forum/m/#!topic/golang-announce/7J...

1.6.3 will include https://github.com/golang/go/commit/fad2bbdc6a686a20174d2e73... in addition to the security fix.

zalmoxes··on Asciinema 1.3 Switches from Go Back to Python
your example went from readable to complete nonsense really quickly.

Mind rewriting

       do
        y <- f x
        fy
or annotating into something that makes sense?

say with an example like response, err := http.Get(someURL)

How would this example look like in haskell if error handling is abstracted away?

zalmoxes··on Asciinema 1.3 Switches from Go Back to Python
People love to complain about handling err, but how is it so much different from handing Maybe and Result in functional languages?
zalmoxes··on Asciinema 1.3 Switches from Go Back to Python
> Batteries included: argparse, pty, locale, configparser, json, uuid, http. All of these excellent modules are used by asciinema and are part of Python’s standard library. Python stdlib’s quality and stability guarantees are order of magnitude higher than of unversioned Go libs from Github (I believe discrete releases ensure higher quality and more stability).

Go also has most of the listed libraries(like http, arg parsing, json) included in stdlib. I'd argue that the the http library in Go is one of the best out there :)

Can't disagree about dependency management, hopefully it gets addressed sooner rather than later. There was a good discussion with the Go team on the topic at Gophercon today.

zalmoxes··on 100 Days of Swift: The Tutorials
I'd like to see some Swift tutorials out there that are not related to Cocoa and other iOS/OSX frameworks.

I've tried Swift several times, but as a sysadmin, I'm interested in cli apps, servers, network libraries etc. I either already know how to do these things or can find out quickly in python/ruby/go or even rust. But whenever I try to find out how to do these already familiar things in Swift, it's a pain to find the right documentation/examples.

zalmoxes··on How to use Elm at work
While it's a WIP right now, Evan has been writing http://guide.elm-lang.org/

I wish Evan allowed others to contribute to the official documentation. Right now Elm feels more like Evan's personal project than a project that is owned by the community.

Other then that, the community has done a good job of writing up documentation, and Richard Feldman is working on a proper book.

zalmoxes··on Go stack traces and the errors package
If I'm understanding you correctly, your complaint is that the errors are part of your packages API, so there is no way to change the errors you return without making breaking changes to your API contract?
zalmoxes··on Go stack traces and the errors package
The go-kit project has a couple other examples for how to handle errors and http status code.

https://github.com/go-kit/kit/blob/master/examples/shipping/...

and more recently https://github.com/go-kit/kit/blob/master/examples/addsvc/tr...

zalmoxes··on Go stack traces and the errors package
What you're describing with net.Error is a sentinel error. var Error = errors.New("your error string")

You can also create a type or a struct that implements error.

Example from stdlib:

``` // PathError records an error and the operation and file path that caused it. type PathError struct { Op string Path string Err error }

func (e *PathError) Error() string { return e.Op + " " + e.Path + ": " + e.Err.Error() } ```

Dave Cheney's other blog post/talk goes into various ways to handle errors in Go here: http://dave.cheney.net/2016/04/27/dont-just-check-errors-han...

zalmoxes··on Program your next server in Go
To any Go programmers ignoring errors is insane. I haven't seen code outside of simple examples ignore errors, and even there it's discouraged.
zalmoxes··on Apple cloud services outage
Trying to access some APIs I work with (DEP,V PP) earlier today and seeing 'akadns' as the common providrer.
zalmoxes··on Apple cloud services outage
It's related to Akamai DNS.
zalmoxes··on A Farewell to FRP
I used https://pragmaticstudio.com/elm to get me started.
zalmoxes··on A Farewell to FRP
No that's not true. Richard from NRI wrote a great blog post about just "trying out" elm in your React app.

http://tech.noredink.com/post/126978281075/walkthrough-intro...

zalmoxes··on A Farewell to FRP
As someone who is just getting started with frontend development, I decided to go with Elm instead of learning JS and React. I found the whole experience very pleasant, even as a beginner.

Not only is the elm code I write reliable, but I've found that adding more features does not bloat my code. Refactoring a codebase as it grows in elm is pleasant, and following the Elm Architecture guides me on the correct structure for the app.

Over the weekend I made a small site to show all Elm conference videos in one place. If you want to play around with 0.17 this project is just a bit above a "Hello World" example. Send a PR! https://elmvids.groob.io/

← PreviousPage 3 of 4Next →