douyin-mall-go-template
ใStar us and watch this project grow! ๐ฑโญ๏ธใA comprehensive Go e-commerce template project demonstrating best practices in Go web development. Built with Gin framework and MySQL, featuring user authentication, product management, shopping cart, and order processing. Perfect for Go beginners to learn real-world application development.
File Explorer
- chan-meng-logo.svg
- bug_report.md
- config.yml
- feature_request.md
- FUNDING.yml
- PULL_REQUEST_TEMPLATE.md
- .gitignore
- douyin-mall-go-template.iml
- modules.xml
- health.go
- user.go
- main.go
- config.yaml.example
- Apifox API Testing Tool Guide From Beginner to Practitioner.md
- Apifox ๆฅๅฃๆต่ฏๅทฅๅ ทไฝฟ็จๆๅ.md
- douyin_mall_go_template_ERD.svg
- douyin_mall_go_template_structure_only.sql
- douyin_mall_go_template_with_data.sql
- ไป้ถๅผๅงๅๅปบ็ตๅ็ณป็ปๆฐๆฎๅบ.md
- douyin-mall-go-template้กน็ฎ็ปๆ.md
- vite.svg
- react.svg
- AuthLayout.jsx
- FormInput.jsx
- LoginForm.jsx
- RegisterForm.jsx
- Login.jsx
- Register.jsx
- auth.js
- http.js
- App.css
- App.jsx
- index.css
- main.jsx
- .gitignore
- eslint.config.js
- index.html
- package-lock.json
- package.json
- postcss.config.js
- README.md
- tailwind.config.js
- vite.config.js
- auth.go
- cors.go
- logger.go
- user_dto.go
- user.go
- routes.go
- user_service.go
- app.log
- mysql.go
- logger.go
- jwt.go
- .gitattributes
- .gitignore
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- go.mod
- go.sum
- GOVERNANCE.md
- LICENSE
- README.md
- README.zh-CN.md
- SECURITY.md
- SUPPORT.md
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
docker build
View Details โผ
docker build
Build an image from a Dockerfile.
docker build .
Build a Docker image using the Dockerfile in the current directory:
docker build {{github.com/creack/docker-firefox}}
Build a Docker image from a Dockerfile at a specified URL:
docker build {{[-t|--tag]}} {{name:tag}} .
Build a Docker image and tag it:
docker run
View Details โผ
docker run
This command is an alias of `docker container run`.
tldr docker container run
View documentation for the original command:
git checkout
View Details โผ
git checkout
Checkout a branch or paths to the working tree.
git checkout -b {{branch_name}}
Create and switch to a new branch:
git checkout -b {{branch_name}} {{reference}}
Create and switch to a new branch based on a specific reference (branch, remote/branch, tag are examples of valid references):
git checkout {{branch_name}}
Switch to an existing local branch:
git clone
View Details โผ
git clone
Clone an existing repository.
git clone {{remote_repository_location}} {{path/to/directory}}
Clone an existing repository into a new directory (the default directory is the repository name):
git clone --recursive {{remote_repository_location}}
Clone an existing repository and its submodules:
git clone {{[-n|--no-checkout]}} {{remote_repository_location}}
Clone only the `.git` directory of an existing repository:
go build
View Details โผ
go build
Compile Go sources.
go build {{path/to/main.go}}
Compile a 'package main' file (output will be the filename without extension):
go build -o {{path/to/binary}} {{path/to/source.go}}
Compile, specifying the output filename:
go build -o {{path/to/binary}} {{path/to/package}}
Compile a package:
go fmt
View Details โผ
go fmt
Format Go source files, printing the changed filenames.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
go fmt
Format Go source files in the current directory:
go fmt {{path/to/package}}
Format a specific Go package in your import path (`$GOPATH/src`):
go fmt {{./...}}
Format the package in the current directory and all subdirectories (note the `...`):
go mod
View Details โผ
go mod
Module maintenance.
go mod init {{module_name}}
Initialize new module in current directory:
go mod download
Download modules to local cache:
go mod tidy
Add missing and remove unused modules:
go run
View Details โผ
go run
Compile and run Go code without saving a binary.
go run {{path/to/file.go}}
Run a Go file:
go run {{path/to/package}}
Run a main Go package:
go test
View Details โผ
go test
Test Go packages (files have to end with `_test.go`).
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
go test
Test the package found in the current directory:
go test -v
[v]erbosely test the package in the current directory:
go test -v ./...
Test the packages in the current directory and all subdirectories:
gofmt
View Details โผ
gofmt
Format Go source code.
gofmt {{path/to/source.go}}
Format a file and display the result to the console:
gofmt -w {{path/to/source.go}}
Format a file, overwriting the original file in-place:
gofmt -s -w {{path/to/source.go}}
Format a file, and then simplify the code, overwriting the original file:
goimports
View Details โผ
goimports
Update Go import lines, adding missing ones and removing unreferenced ones.
goimports {{path/to/file.go}}
Display the completed import source file:
goimports -w {{path/to/file.go}}
Write the result back to the source file instead of `stdout`:
goimports -w -d {{path/to/file.go}}
Display diffs and write the result back to the source file:
golangci-lint
View Details โผ
golangci-lint
Parallelized, smart, and fast Go linters runner that integrates with all major IDEs and supports YAML configuration.
golangci-lint run
Run linters in the current folder:
golangci-lint linters
List enabled and disabled linters (Note: Disabled linters are shown last, do not mistake them for enabled ones):
golangci-lint run {{[-E|--enable]}} {{linter}}
Enable a specific linter for this run:
mysql
View Details โผ
mysql
The MySQL tool.
mysql {{database_name}}
Connect to a database:
mysql {{[-u|--user]}} {{user}} {{[-p|--password]}} {{database_name}}
Connect to a database, user will be prompted for a password:
mysql {{[-h|--host]}} {{database_host}} {{database_name}}
Connect to a database on another host:
nano
View Details โผ
nano
Text editor. An enhanced `pico` clone.
See also: `pico`, `rnano`.
nano {{path/to/file1 path/to/file2 ...}}
Open specific files, moving to the next file after closing the previous one:
nano {{[-I|--ignorercfiles]}}
Start the editor without using configuration files:
nano +{{line}},{{column}} {{path/to/file}}
Open a file and position the cursor at a specific line and column:
npm install
View Details โผ
npm install
Install Node packages.
npm {{[i|install]}}
Install dependencies listed in `package.json`:
npm {{[i|install]}} {{package_name}}@{{version}}
Download a specific version of a package and add it to the list of dependencies in `package.json`:
npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}
Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
npm run
View Details โผ
npm run
Run a script.
npm run
List available scripts:
npm run {{script_name}}
Run a script:
npm run {{script_name}} -- {{argument}} {{--option}}
Pass arguments to a script:
