https://github.com/bench/generator-go
A Yeoman generator to scaffold a simple golang application
https://github.com/bench/generator-go
golang javascript scaffold yeoman
Last synced: 2 months ago
JSON representation
A Yeoman generator to scaffold a simple golang application
- Host: GitHub
- URL: https://github.com/bench/generator-go
- Owner: bench
- License: mit
- Created: 2014-10-27T21:36:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2026-01-25T19:20:21.000Z (5 months ago)
- Last Synced: 2026-01-26T01:21:38.011Z (5 months ago)
- Topics: golang, javascript, scaffold, yeoman
- Language: JavaScript
- Homepage:
- Size: 9.1 MB
- Stars: 48
- Watchers: 3
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# A non-opinionated golang code generator
A [Yeoman](http://yeoman.io) generator for the [golang](http://golang.org/) programming language.
### What is golang ?
See the [Golang documentation](https://golang.org/doc/)
### Why a generator ?
The Golang team defined [guidelines](https://blog.golang.org/organizing-go-code) to organize code and structure an application.
The generator builds a standard directory hierarchy complying with those guidelines.
## Usage
1. Install yeoman
```
$ npm install -g yo
```
2. Install the generator
```
$ npm install generator-go
```
3. Run the generator
```
$ yo go
```
**That's all folks !**
This will generate a minimalist directory hierarchy, a makefile and a .gitignore in your *$GOPATH* folder.
CURRENT FOLDER
├── go.mod
├── hello
│ ├── hello.go # source file
│ └── hello_test.go # test file
├── main.go # app entrypoint
├── Makefile # build targets
└── README.md
Once built, you can run your application
```
$ make run
```
Compile sources and build binary
```
$ make install
```
Run all tests
```
$ make test
```
And clean up the binary
```
$ make clean
```
## How to contribute
1. Fork the project
2. Clone your forked project locally
```
$ git clone https://github.com/your_repo/generator-go.git
$ cd generator-go
```
3. Modify sources
4. Symlink the package folder
```
$ sudo npm link
```
5. Test your generator
```
$ yo go
```
6. Submit a pull request
This project welcomes all contributors, feel free to apply !
## Dependencies
This project depends on
* [golang](http://golang.org/)
* [Yo](https://github.com/yeoman/yo) (the scaffolding tool from Yeoman)
* [GNU make](https://www.gnu.org/software/make/manual/make.html)