At Github, we want to start new projects faster using best practices with a predefined structure and focusing on core ideas implementation rather than wasting time on environment configuration and copying boilerplate code.
I defined a spec template that I could use to quickly start building a full-fledged project.
In each directory, there is a README.md and an OWNERS, which explains what the directory does and who owns it.
Labels denger: Read about the go-project-layout tag design. We have provided in the github-label-syncer warehouse label synchronizer.
Note: You can get started quickly with go-project-layout.
- Generate a new repository from the template.
- Clone the repository locally.
- Update files, read the README files in each directory.
- Write your code and tests.
Work with Makefile
โฏ make help # show help
โฏ make build # build binary
Git hook(push & commit)
โฏ make # To trigger the hook script, move to.git
โฏ tree .git/hooks
.git/hooks
โโโ applypatch-msg.sample
โโโ commit-msg
โโโ commit-msg.sample
โโโ fsmonitor-watchman.sample
โโโ post-update.sample
โโโ pre-applypatch.sample
โโโ pre-commit
โโโ pre-commit.sample
โโโ pre-merge-commit.sample
โโโ pre-push
โโโ pre-push.sample
โโโ pre-rebase.sample
โโโ pre-receive.sample
โโโ prepare-commit-msg.sample
โโโ push-to-checkout.sample
โโโ update.sample
โฏ cp ../sealer/_output/bin/sealer/linux_amd64/sealer ./ # add big binary file
โฏ git add .
โฏ git commit -a -s -m "nono" # Excess commit blocking
kubecub : Running local kubecub pre-commit hook.
kubecub : File sealer is 71 MB, which is larger than our configured limit of 2 MB
kubecub : If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=42000000 for 42MB. Or, commit with the --no-verify switch to skip the check entirely.
kubecub : Commit aborted
โฏ rm -rf .git # remote big binary
โฏ git commit -a -s -m "nono" # Bad commit blocking
kubecub : Running local kubecub pre-commit hook.
kubecub : Running the kubecub commit-msg hook.
fakehsh: subject does not match regex [^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*]
fakehsh: subject length less than min [10]
kubecub : Please fix your commit message to match kubecub coding standards
kubecub : https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md
โฏ git commit -a -s -m "docs(main): README-en Chinese documentation"
kubecub : Running local kubecub pre-commit hook.
kubecub : Running the kubecub commit-msg hook.
[main b3b339f] docs(main): README-en Chinese documentation
1 file changed, 29 insertions(+)
โฏ git push origin main
Work with actions
Actions provide handling of PR and issue.
We used the bot ๐@kubbot, It can detect issues in Chinese and translate them to English, and you can interact with it using the command /comment
.
Comment in an issue:
โฏ /intive
Work with Tools
โฏ make tools
Work with Docker
โฏ make deploy
// architecture diagram
MVC Architecture Design:
// MVC Architecture Design
Catalog standardization design structure:
.go-project-layout
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ LICENSE # License information
โโโ Makefile # Makefile for building and running the project
โโโ README.md # Project overview in English
โโโ README_zh-CN.md # Project overview in Chinese
โโโ api # API-related files
โ โโโ OWNERS # API owners
โ โโโ README.md # API documentation
โโโ assets # Static assets, such as images and stylesheets
โ โโโ README.md # Assets documentation
โโโ build # Build-related files
โ โโโ OWNERS # Build owners
โ โโโ README.md # Build documentation
โโโ cmd # Command-line tools and entry points
โ โโโ OWNERS # Command owners
โ โโโ README.md # Command documentation
โโโ configs # Configuration files
โ โโโ OWNERS # Configuration owners
โ โโโ README.md # Configuration documentation
โ โโโ config.yaml # Main configuration file
โโโ deploy # Deployment-related files
โ โโโ OWNERS # Deployment owners
โ โโโ README.md # Deployment documentation
โโโ docs # Project documentation
โ โโโ OWNERS # Documentation owners
โ โโโ README.md # Documentation index
โโโ examples # Example code and usage
โ โโโ OWNERS # Example owners
โ โโโ README.md # Example documentation
โโโ init # Initialization files
โ โโโ OWNERS # Initialization owners
โ โโโ README.md # Initialization documentation
โโโ internal # Internal application code
โ โโโ OWNERS # Internal code owners
โ โโโ README.md # Internal code documentation
โ โโโ app # Application logic
โ โโโ pkg # Internal packages
โ โโโ utils # Utility functions and helpers
โโโ pkg # Public packages and libraries
โ โโโ OWNERS # Package owners
โ โโโ README.md # Package documentation
โ โโโ common # Common utilities and helpers
โ โโโ log # Log utilities
โ โโโ tools # Tooling and scripts
โ โโโ utils # General utility functions
โ โโโ version # Version information
โโโ scripts # Scripts for development and automation
โ โโโ LICENSE_TEMPLATES # License templates
โ โโโ OWNERS # Script owners
โ โโโ README.md # Script documentation
โ โโโ githooks # Git hooks for development
โ โโโ make-rules # Makefile rules and scripts
โโโ test # Test files and test-related utilities
โ โโโ OWNERS # Test owners
โ โโโ README.md # Test documentation
โโโ third_party # Third-party dependencies and libraries
โ โโโ README.md # Third-party documentation
โโโ tools # Tooling and utilities for development
โ โโโ README.md # Tool documentation
โโโ web # Web-related files, such as HTML and CSS
โโโ OWNERS # Web owners
โโโ README.md # Web documentation
We welcome everyone to join us and contribute to go-project-layout, whether you are new to open source or professional. We are committed to promoting an open source culture, so we offer community members neighborhood prizes and reward money in recognition of their contributions. We believe that by working together, we can build a strong community and make valuable open source tools and resources available to more people. So if you are interested in go-project-layout, please join our community and start contributing your ideas and skills!
We take notes of each biweekly meeting in GitHub discussions, and our minutes are written in Google Docs.
go-project-layout maintains a public roadmap. It gives a a high-level view of the main priorities for the project, the maturity of different features and projects, and how to influence the project direction.
kubecub Our goal is to build a top-level open source community. We have a set of standards, in the Community repository.
If you'd like to contribute to this go-project-layout repository, please read our contributor documentation.
Before you start, please make sure your changes are in demand. The best for that is to create a new discussion OR Slack Communication, or if you find an issue, report it first.
Kubecub is licensed under the MIT License. See LICENSE for the full license text.