GoTypesLearn is an interactive CLI tool designed to help developers learn about Go's data types from the standard library. It provides comprehensive, colorful explanations and examples of basic and composite types, interfaces, and type conversions.
- 📚 Comprehensive coverage of Go's type system
- 🌈 Colorful command-line output with syntax highlighting
- 🧩 Organized by type categories for easy navigation
- 📝 Practical examples and best practices
- 💡 Tips for avoiding common pitfalls
go install github.com/yourusername/gotypeslearn@latestgit clone https://github.com/yourusername/gotypeslearn.git
cd gotypeslearn
go build -o gotypeslearn# Show general help and available commands
gotypeslearn
# Learn about basic data types (overview)
gotypeslearn basic
# Learn about a specific basic type
gotypeslearn basic int
gotypeslearn basic float
gotypeslearn basic string
gotypeslearn basic bool
gotypeslearn basic byte
gotypeslearn basic rune
gotypeslearn basic complex
# Learn about composite types (overview)
gotypeslearn composite
# Learn about specific composite types
gotypeslearn composite array
gotypeslearn composite slice
gotypeslearn composite map
gotypeslearn composite struct
gotypeslearn composite pointer
gotypeslearn composite function
gotypeslearn composite channel
# Learn about interfaces
gotypeslearn interface
# Learn about type conversion
gotypeslearn conversionint(and variants: int8, int16, int32, int64, uint, uint8, etc.)float(float32, float64)boolstringbyte(alias for uint8)rune(alias for int32, represents Unicode code points)complex(complex64, complex128)
array(fixed-size collection of elements)slice(dynamic-size sequence of elements)map(key-value pairs)struct(custom data type with named fields)pointer(reference to memory address)function(first-class functions)channel(communication between goroutines)
interface(type definitions based on behavior)conversion(converting between types)
cmd/: Command implementationsinternal/examples/: Code examples for each typeinternal/printer/: Formatting utilities for console outputmain.go: Application entry point
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
