All Projects → chenaoxd → go-proj-starter

chenaoxd / go-proj-starter

Licence: other
Golang project starter

Programming Languages

Makefile
30231 projects
go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to go-proj-starter

golang-gqlgen-reactjs-subscription-demo
GraphQL Subscription with Golang/React JS & React Apollo Client Subscription
Stars: ✭ 29 (+123.08%)
Mutual labels:  golang-examples
golangschool
原生golang语言开发的web网站
Stars: ✭ 98 (+653.85%)
Mutual labels:  golang-examples
go-notebook
Go-Notebook is inspired by Jupyter Project (link) in order to document Golang code.
Stars: ✭ 33 (+153.85%)
Mutual labels:  golang-examples
go-api-basic
A Go RESTful API template
Stars: ✭ 313 (+2307.69%)
Mutual labels:  golang-examples
samples-go
Temporal Go SDK samples
Stars: ✭ 269 (+1969.23%)
Mutual labels:  golang-examples
Learngo
1000+ Hand-Crafted Go Examples, Exercises, and Quizzes
Stars: ✭ 11,847 (+91030.77%)
Mutual labels:  golang-examples
todo-app
🔥 REST API для приложения списков ToDo
Stars: ✭ 78 (+500%)
Mutual labels:  golang-examples
project-template
Sample Go Project Template (based on the layout from the Standard Project Layout repo)
Stars: ✭ 81 (+523.08%)
Mutual labels:  golang-examples
goexample
Various examples of tests I do on a daily basis before implementing golang
Stars: ✭ 82 (+530.77%)
Mutual labels:  golang-examples
go-zero-to-hero
Golang Learning doc + programs
Stars: ✭ 17 (+30.77%)
Mutual labels:  golang-examples
Golang tutorial zero to hero
This is a tutorial, course, or walk through to teach first time developers how to use golang
Stars: ✭ 24 (+84.62%)
Mutual labels:  golang-examples
GoCurrency
Simple currency converter. Insert an amount, what currency to convert from and what currency to convert to.
Stars: ✭ 29 (+123.08%)
Mutual labels:  golang-examples
eventsourcing-go
Event Sourcing + CQRS using Golang Tutorial
Stars: ✭ 75 (+476.92%)
Mutual labels:  golang-examples
ds-algo
Implementation of common Data Structures and Algorithms with Go
Stars: ✭ 177 (+1261.54%)
Mutual labels:  golang-examples
zap-examples
Examples of using Uber's zap Go logging library
Stars: ✭ 92 (+607.69%)
Mutual labels:  golang-examples
golang-cpp-basic-example
A simple example demonstrating how to call C++ from Go
Stars: ✭ 49 (+276.92%)
Mutual labels:  golang-examples
shortlink
High-Performance Shortlink ( Short URL ) app creator in Golang. For privacy reasons, you may prefer to host your own short URL app and this is the one to use.
Stars: ✭ 130 (+900%)
Mutual labels:  golang-examples

Golang Project Starter

This project contains the most common used features used in a golang project, which includes

  • Makefile using to run most common functions
  • Debug tool using delve
  • Automatically install dependencies using GOPROXY
  • Automatically restarted webdev server
  • Cross compilation demonstration command
  • Automatically linting before git commit

Project Layout

/cmd

Main applications for this project.

The directory name for each application should match the name of the executable you want to have (e.g., /cmd/myapp).

Don't put a lot of code in the application directory. If you think the code can be imported and used in other projects, then it should live in the /pkg directory. If the code is not reusable or if you don't want others to reuse it, put that code in the /internal directory. You'll be surprised what others will do, so be explicit about your intentions!

It's common to have a small main function that imports and invokes the code from the /internal and /pkg directories and nothing else.

( From https://github.com/golang-standards/project-layout#cmd )

/internal

Private application and library code. This is the code you don't want others importing in their applications or libraries.Put your actual application code in the /in

ternal/app directory (e.g., /internal/app/myapp) and the code shared by those apps in the /internal/pkg directory (e.g., /internal/pkg/myprivlib).

( From https://github.com/golang-standards/project-layout#internal )

References

Project layout is mainly referring the two following projects (articles):

  1. Standard Go Project Layout
  2. Standard Package Layout

Makefile

The Makefile contains all the most common used functions.

make help

List all the available commands to run.

make deps

Install all the dependencies using the goproxy.io GOPROXY. And the golint pre-commit git hook will be installed too.

make run mod=module

Run the specific module which is located in the cmd package.

make webdev

Start an web dev server which will automatically restart when the .go files is modified. And this function is supported by modd. You can change the server startup command by modifying the modd.conf file.

NOTE: You need to run make deps_web first before using this.

make debug mod=module

Start a delve debug server at localhost:33333, and then you can use some debug client to connect to the debug server such as sebdah/vim-delve if you are using vim.

make lint

Run go lint on all packages

make test

Run all test code

make build-linux mod=module

Cross compile the specific module, the default OS is set to linux and default ARCH is set to amd64.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].