All Packages
· β˜• 3 min read
cobra package cobra is command line tool that can be used to build command line tools! installation Get cobra installed go get -u usage cobra init creating a new CLI application is as easy as running cobra init cobra init --pkg-name This should create new cli application: main root main.go 1 2 3 4 5 6 7 package main import "" func main() { cmd.Execute() } root.

· β˜• 2 min read
flag package flag package provides types and functions useful for working with command line flags. installation flag package is part of standard Go library at flag usage Simple usage of flag var variable_name = flag.Type("flag_name", "initial_value", "help_message") flag.Type defines the data type of flag flag.String(), Bool(), Int(), etc. flag_name is used from command line to pass value to flag. initial_value is used to initialize flag to some default value and help_message is used to provide help information to user.

· β˜• 2 min read
json package json package is part of Go standard library. It providers useful types and functions that can be used to work with json data and Go data types. installation json package is part of standard Go library at encoding/json usage There are two main operation defined while working with json, Marshaling : Marshaling is conversion of Go data types to json. Unmarshaling : Converting json to Go data type.

· β˜• 1 min read
fresh package Fresh package is file watcher that rebuilds your project and provide hot-reloading like capability so that you do not have to restart web server again and again. installation go get usage Go to project folder and run fresh package source and documentation