Skip to content

Instantly share code, notes, and snippets.

@rongzhus
rongzhus / createDirIfNotExist.go
Created July 10, 2018 09:28
Create Dir If not Exist
package main
import (
"fmt"
"os"
)
func main() {
dir := "~/yourdirname"
CreateDirIfNotExist(dir)
@rongzhus
rongzhus / json2map.go
Created July 9, 2018 05:10
simple json convert to map in go
package main
import (
"encoding/json"
"fmt"
)
func main() {
jsondata := `{
"Errors":"params should be int!",
package main
import (
"encoding/json"
"fmt"
)
type People struct {
Name string
Age int32