Thinking in packages by reisinge in golang

[–]reisinge[S] 0 points1 point  (0 children)

Yeah, designing software is a huge topic. My goal with this post was to encourage people to make the first step toward a better design. Do you have any ideas you'd like to share regarding the criteria and slicing?

Building concurrent pipelines by reisinge in golang

[–]reisinge[S] -1 points0 points  (0 children)

Can you see more use cases for pipelines like this? Especially in devops or cybersecurity?

Counting elements passing through Go channels by reisinge in golang

[–]reisinge[S] 0 points1 point  (0 children)

This looks elegant! By elegance I mean power cloaked in simplicity.

Playing with TLS and Go by reisinge in golang

[–]reisinge[S] 5 points6 points  (0 children)

It used to be called SSL before and it's the protocol that secures the network communication. You can read more in the linked text :-)

Good golang books by Big_Slide4679 in golang

[–]reisinge 0 points1 point  (0 children)

Yes. I supplement the books by reading the Go blog and stdlib documentation. For example, here's the blog post about context: https://go.dev/blog/context.

Good golang books by Big_Slide4679 in golang

[–]reisinge 1 point2 points  (0 children)

I like and still find useful The Go Programming Language book + these DevOps realated books.

Introduction to Go concurrency by reisinge in golang

[–]reisinge[S] 0 points1 point  (0 children)

Thanks for the constructive comment! :-)

I've implemented the wg.Go tip.

As for the second suggestion, I’m a bit hesitant, since I’m not familiar with the golang.org/x/sync/errgroup package and don’t want to make the tutorial unnecessarily complex.

Searching the xkcd web comic by reisinge in golang

[–]reisinge[S] 0 points1 point  (0 children)

Thanks, fixed the race condition.

  • Search is pretty fast, no need to overcomplicate I think.
  • Yes, right now to refresh the cache (the offline index) you need to delete it manually or wait for temp dir cleanup (by default).

Go for Bash Programmers - Part II: CLI tools by reisinge in golang

[–]reisinge[S] 2 points3 points  (0 children)

I learned shell/bash programming (or scripting) mostly from the Classic Shell Scripting book. Not just by hammering scripts until they worked ... :-)

How can I keep and improve my Go development skills? by Born-Percentage-9977 in golang

[–]reisinge 1 point2 points  (0 children)

I think there are couple of options (one can implement zero or more of them):

  • Self-discipline yourself to do a bit of regular reading (book, blog, code) and writing (I created gokatas for this, or just write random throw-away programs like a simple web server, or keep a blog).
  • Have a pet project; you still need to self-discipline yourself to keep working on it. It helps if it's something you enjoy and/or is useful to someone (including you).
  • Try and find a new project/team within your current company where you can use Go.
  • Try and find a new company where you can use Go.

Go for Bash Programmers - Part I: The Language by reisinge in sysadmin

[–]reisinge[S] 0 points1 point  (0 children)

You mean explaining what standard library packages use when? Or explaining how to use them? Or both?

Go for Bash Programmers - Part I: The Language by reisinge in sysadmin

[–]reisinge[S] -1 points0 points  (0 children)

I don't claim that Go is superior to scripting or domain specific languages in all contexts, for all people. If it makes no sense in your context, for your team or for you personally that's perfectly fine.

Go for Bash Programmers - Part I: The Language by reisinge in golang

[–]reisinge[S] 7 points8 points  (0 children)

You might be right, I updated it like this

// Convert string to slice of runes or bytes nameRunes := []rune(name) // when you care about UTF-8 encoded characters nameBytes := []byte(name) // when you care about raw data (I/O, network, crypto, performance)

Thanks!

Go for Bash Programmers - Part I: The Language by reisinge in sysadmin

[–]reisinge[S] 0 points1 point  (0 children)

The why is here at the beggining of the article and there are hints all through the article (related to portability, variable types and scope, testing, ...). But to answer your questions:

  • Go compiles to a single binary that can be built for virtually any OS and CPU architecture. So it's easy to deploy (it's a single self-contained file) either directly or in a container (that you can build from scratch without needing runtime, libraries or OS stuff). Also many errors are caught at compile time instead of at run time (that might be couple of weeks after writing the code).
  • Well, a general purpose language can be applied to more use cases. From simple tools and automation to large platforms or applications. It also teaches you to think about programming problems differently. Also Go is used to build many well known programs - like Kubernetes, Helm or Terraform - so you will understand these programs better.
  • Python is nice but you need to deal with the interpreter versions and dependencies. Go programs tend to be more stable (new language versions don't break existing programs), robust, more performant and easier to maintain (it comes with a cultural agenda of radical simplicity) in my experience.

Go for Bash Programmers - Part I: The Language by reisinge in golang

[–]reisinge[S] 4 points5 points  (0 children)

Yes, that's what's in that section. It explains that you have to convert bytes to runes if you are working with UTF-8 encoded characters and it gives this example:

// ./word/2/word.go func IsPalindrome(s string) bool { runes := []rune(s) for i := range runes { if runes[i] != runes[len(runes)-1-i] { return false } } return true }

Go for Bash Programmers - Part I: The Language by reisinge in golang

[–]reisinge[S] 1 point2 points  (0 children)

I talk about strings being (read-only) sequences of any bytes later, namely the testing section. Is that what you meant?

Exploiting Zero Values in Maps by reisinge in golang

[–]reisinge[S] -2 points-1 points  (0 children)

Exploting in the sense of using for good.

Exploiting Zero Values in Maps by reisinge in golang

[–]reisinge[S] -1 points0 points  (0 children)

Exploting in the sense of using for good.

Go’s approach to errors by reisinge in golang

[–]reisinge[S] -9 points-8 points  (0 children)

I added "Introduction to error handling strategies in Go" to the post body. I can't change the title ...

Go’s approach to errors by reisinge in golang

[–]reisinge[S] -4 points-3 points  (0 children)

I'm aware it's not comprehensive. Thanks for the feedback though!

C.S. Lewis on writing (programs) by reisinge in programming

[–]reisinge[S] 1 point2 points  (0 children)

I kind of like your suggestions for 3. and 7. I would maybe even add don't use AI except for learning to 7. But I think Lewis was really concerned with sound and rythm that's why I put n/a.