https://github.com/rellyson/go-generics-structs
Generics and structs usage example (available in go >=1.18 version)
https://github.com/rellyson/go-generics-structs
generics golang
Last synced: 5 months ago
JSON representation
Generics and structs usage example (available in go >=1.18 version)
- Host: GitHub
- URL: https://github.com/rellyson/go-generics-structs
- Owner: rellyson
- Created: 2022-04-12T18:50:03.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-12T20:25:31.000Z (about 4 years ago)
- Last Synced: 2024-06-20T20:55:58.558Z (about 2 years ago)
- Topics: generics, golang
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang - Using Generics with Structs
## Motivation
Since version 1.18, Go comes shipped with support for generics. This project aims to exercise the usage of generics and structs, building flexible packages.
## About
A vehicle dealership need a way to manage their inventory. They have three types of vehicles: cars, motorcycles and trucks.
As a solution, we going to implement an inventory. The inventory implementation must have generics types to give a flexible way of managing the inventory and provide an easy implementation for new types of vehicles.
## Links
- [Official generics tutorial](https://go.dev/doc/tutorial/generics)
- [Go 1.18 Release Notes](https://go.dev/doc/go1.18)