The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,226 other followers

Archive for the ‘Go (golang)’ Category

golang – joining a URI (either with our without terminating slash) with a URI part

Posted by jpluimers on 2020/10/06

path.Join is for file paths, which will call path.Clean and malform the path by converting double slash in front of the authority in a URI into a single slash.

The workaround is to parse the URI, then join the path bit.

One day I will encapsulate all that.

Some relevant bits for when I write that encapsulation:

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

Baseboard Management Controller: bmc-toolbox · GitHub, supporting Dell, HP and SuperMicro

Posted by jpluimers on 2020/10/01

Cool stuff by booking.com for interrogating Baseboard Management Controller on Dell, HP and SuperMicro equipment using golang.

A bunch of tools to ease BMC management.

Source: bmc-toolbox · GitHub

Via: [WayBack] bmclib talks to the Baseboard Management Controller of your server. It is written in Go, and understands Dell iDRAC, HP C… – Kristian Köhntopp – Google+

Repositories:

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

Go character and string literals: regular (‘), double (“) and back-tick (`) quotes

Posted by jpluimers on 2020/10/01

For my link archive:

Back-ticks can be very useful for instance when you need to specifying json tags.

References for that:

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

variables – What is “_,” in a Golang declaration? – Stack Overflow

Posted by jpluimers on 2020/09/29

As a (then) go lang n00b, the less upvoted answers helped me e lot: [WayBack] variables – What is “_,” in a Golang declaration? – Stack Overflow:

  • The Go compiler won’t allow you to create variables that you never use.

    for i, value := range x {
       total += value
    }

    The above code will return an error message “i declared and not used”.

    Since we don’t use i inside of our loop we need to change it to this:

    for _, value := range x {
       total += value
    }
  • _ is the blank identifier. Meaning the value it should be assigned is discarded.

    Here it is the value of example key that is discarded. The second line of code would discard the presence boolean and store the value in prs.
    So to only check the presence in the map, you can discard the value. This can be used to use a map as a set.

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

learning golang

Posted by jpluimers on 2020/05/21

Interesting course: [WayBack] Go: The Complete Developer’s Guide (Golang) | Udemy Master the fundamentals and advanced features of the Go Programming Language (Golang)

It covers:

  • Basics / Hello world
  • Structs
  • Pointers
  • Interfaces
  • Channels / Go Routines

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

 
%d bloggers like this: