Skip to content

amitkumardube/golang-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang - api

golang API to perform the CRUD operations

  • C : create
  • R : read
  • U : update
  • D : delete

What these APIs do?

  • The APIs perform CRUD operations on the string
  • To keep it lightweight project, the APIs don't connect to database

How to use this project?

  • install go binary and configure GOROOT env variable as per the location of GO binary
  • create a directory structure dir_path/src. Where dir_path should be set as GOPATH env variable
  • clone this code under src repo
  • run go run main.go and the application will start on port 8000

List of APIs

How to use automated testing

  • The go testing package supports automated testing.
  • In order to run test testcases , please run go test -v ./...
  • This will trigger test cases in all the packages ( root and sub packages ).
  • To see the test coverage, please use flags like -cover and -coverprofile while running to test command.
  • Commands are go test -v -cover ./... or go test -v -coverprofile=cover.txt ./...
  • Once you have cover.txt file, you can use a built in tool called cover to create an html report from this txt file.
  • Command is - go tool cover -html=cover.txt -o cover.html.
  • Open cover.html in browser to review the test coverage.

About

Here we will work on some golang activities on google cloud

Resources

Stars

Watchers

Forks

Packages

No packages published