Golang is awesome!

golangAfter a few weeks of learning Golang... I've reached the conclusion that it's awesome, I totally love it.

This is absolutely perfect for microservices. I coded an HTTP server using only 15 lines of code. From here, I could expand and implement routing to serve dynamic content much like Node.js... but what's better here is... it's native! whatever you develop can be deployed natively on Windows, Mac, Linux, Android, and IOS into a single executable! the performance of what you build far outweighs other languages.

Golang seems to be a combination of the C++ syntax and a more friendly syntax like JavaScript. It is as if they both had a baby together. I will for sure continue learning this.


package main

import(
"fmt"
"net/http"
)

func main(){
fmt.Println("Server started on port: " + settings["port"])
http.HandleFunc("/", serverReply)
http.ListenAndServe(":"+settings["port"], nil)
}

func serverReply(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w, "%s", "Port is: "+settings["port"])
}



LewyBlog - Blog software created by Lewis Williams