Skip to content

Sefikcan/address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swagger Implementation

  • Add the necessary code under the pkg directory.
  • Install the required Go packages with the following command:
go install github.com/swaggo/swag/cmd/swag@latest
go get -u github.com/swaggo/fiber-swagger
  • Then, run the following init command, specifying the folder of the relevant main.go file:
swag init -g cmd/server/main.go -o docs

Unit Test Implementation

  • Install the gomock package.
go get github.com/golang/mock/gomock
  • Then, run the command to generate mocks for the service or repositories you need to mock.
  • The following example creates a mock for a service:
mockery --name=AddressService --dir=internal/address/service --output=internal/address/service/mocks
  • If the mockgen command is not installed, use one of these commands to install it:
go install github.com/golang/mock/mockgen@latest
or
go install github.com/vektra/mockery/v2@latest
  • The following example creates a mock for a repository.
mockery --name=AddressRepository --dir=internal/address/repository --output=internal/address/repository/mocks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors