Personal learning project following the official Go tutorials, then expanded into a small full-stack web app (Gin + MySQL + Vue.js).
greetings/— Standalone Go module from the Create a Go module tutorial. Provides aHellofunction with unit tests.hello/— Consumer module from the Call your code from another module tutorial. Importsgreetingsvia a localreplacedirective.my_app/— Full-stack web application: Gin REST API backed by MySQL, with a plain HTML + Vue.js (CDN) front end for user login and CRUD management.
- Backend: Go + Gin router, MySQL via
database/sql, bcrypt password hashing. - Routes: user CRUD (
/users), login/logout (/users/login), home/success/404 pages. - Frontend: static HTML pages in
client/, styled via a sharedglobal.css, with Vue.js 3 (CDN build) for the login page's interactivity.
- Getting started
- Create a module
go mod init example.com/greetings - Call module code from another module
go mod edit -replace example.com/greetings=../greetings go mod tidy - Add a test
go test -v - Compile and install
go buildcompiles the package and its dependencies but does not install the result.go installcompiles and installs the package.
Add the MySQL client to PATH (PowerShell, run as admin):
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "Machine") + ";C:\Program Files\MySQL\MySQL Server 8.0\bin", "Machine")golang.org/x/crypto/bcryptgo get golang.org/x/crypto/bcrypt