Golang – Encode Json data

This recipe demonstrates how to use struct to encode to json data. The struct type and its attributes have to be exportable in order for json encoding. The json data uses the attributes of struct type as keys if there is no customize key name defined. package main import ( "encoding/json" "fmt" "log" ) // … Continue reading Golang – Encode Json data


Golang – How to write ssh.HostKeyCallback

ssh.InsecureIgnoreHostKey is lazy and seems popular? I have seen many tutorials and some codes in github that ignore host key checking, this is not recommended as you need to ensure everytime you connect to the known ssh server is the actual server that serves your purpose, if host key checking is ignore then any server … Continue reading Golang – How to write ssh.HostKeyCallback