Category Archives: golang

Go webserver on Apache

Go language allows create very easily webserver. Let’s consider a full working example of a simple web server at https://golang.org/doc/articles/wiki/ implemented in the file web8080.go: Code above could be one of the several web application implemented in go language. Each … Continue reading

Posted in golang, workday | Tagged , , | Leave a comment

Brief go lang programs

Here is list of brief go lang programs Thursdays biweekly Corner clothesline Hexa string back to ASCII SVG command path for a circle arc URI percent conversion Printing bit literals – in this case ‘gm’ String to binary bytes Binary … Continue reading

Posted in golang, workday | Leave a comment

Hello Website on GKE Cluster

Let’s explore, how deploy web application “Hello Website” written in go language at Google Kubernetes Engine Cluster. Source code for “Hello Website” in the file helloweb.go Source code for dockerfile Steps: At https://console.cloud.google.com/apis/library search for Kubernetes (k8s) and then enable … Continue reading

Posted in golang, workday | Tagged | Leave a comment

Short decimal ASCII characters table

Seven bit characters ASCII table is with us long time. Once a while we need to know value of ASCII character, mostly out of the alphabet characters. For example on Windows it’s possible to type any character by pressing <ALT> … Continue reading

Posted in golang, workday | Tagged , | Leave a comment

go: Marshal and Unmarshal json

Here is an example playing with json, see https://play.golang.org/p/fHA1im6vPIG

Posted in golang, workday | Leave a comment

go: Legacy character encoding conversion to UTF-8

Go language is using UTF-8 encoding, but sometimes text files are encoded in some other encoding, like Windows-1250. Here is example, how it could be done https://play.golang.org/p/K3JAeM4nCVD Decoding table used in this program was developed from page CP1250.TXT at ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/ … Continue reading

Posted in golang, workday | Leave a comment

go: Enumeration

There is no enumeration in Golang, but here is an example, which could be good start for any project, which needs to utilize enumeration. See https://play.golang.org/p/pD29UI37iq1

Posted in golang, workday | Leave a comment

go: Three dots/ellipses notation and variadic function; arrays vs slices

Go program example below explores arrays, slices and three dots notation. Arrays and slices are similar, arrays have static usage, slices are dynamic. Arrays are type values, fixed length sentences of items of the same type. Slices are reference types. … Continue reading

Posted in golang, workday | Leave a comment

go: Concurrent records processing with channels

Let’s say we have list of records, which can be processed concurrently. Processing time can be different. In example below processing time depends on two parameters. There are used non buffered input and output channels.  There are these steps: Submitting … Continue reading

Posted in golang, workday | Leave a comment

go: base64 decoding

Here is an example how to decode base64 encoded strings https://play.golang.org/p/iojjUKwvZvn It uses encoding packages encoding/base64 and encoding/hex . package main import ( “fmt” “encoding/base64” “encoding/hex” ) func isAscii7printable(bytes []byte)(bool){ for _, b := range bytes { if b < … Continue reading

Posted in golang, workday | Leave a comment