Skip to content

josecordaz/docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delete a local branch

    git branch -d the_local_branch

Delete remote branch

    git push origin --delete the_remote_branch

Marshall golang

strObj, err := json.MarshalIndent(obj, "", " ")
if err != nil {
    panic(err)
}

Unmarshall golang

if err := json.Unmarshal(byt, &dat); err != nil {
     panic(err)
}
fmt.Println(dat)

Log info to file

ex, err := os.Executable()
if err != nil {
	return err
}
exPath := filepath.Dir(ex)

f, err := os.OpenFile(exPath+string(os.PathSeparator)+"testlogfile", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0755)
if err != nil {
    log.Fatalf("error opening file: %v", err)
}
defer f.Close()

log.SetOutput(f)

log.Println("test")

About

Most used commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published