Configuration management assistant component that helps develop golang projects.
📋 JSON Configuration Loading: Simple and efficient JSON configuration file parsing 🔄 Workspace Integration: Perfect integration with go-work package workspace management ⚡ Lightweight Design: Focused on core configuration management with minimum dependencies 🌍 Structure Conversion: Convenient conversion from configuration to workspace structures 📝 Standard Format: Support of standard JSON configuration format serialization and deserialization
go get github.com/go-mate/go-mate/workmateCreate configuration file mate.json:
{
"workRoot": "/Users/admin/go-projects/mate",
"projects": [
"/Users/admin/go-projects/mate/go-work",
"/Users/admin/go-projects/mate/depbump",
"/Users/admin/go-projects/mate/tago",
"/Users/admin/go-projects/mate/go-lint",
"/Users/admin/go-projects/mate/go-mate"
]
}package main
import (
"github.com/go-mate/go-mate/workmate"
"github.com/go-mate/go-work/worksexec"
"github.com/yyle88/osexec"
)
func main() {
// Load configuration file
workspace := workmate.NewWorkspace("mate.json")
// Convert to go-work format
goWorkspace := workspace.GetWorkspace()
// Create execution configuration
execConfig := osexec.NewCommandConfig()
workspaces := []*workspace.Workspace{goWorkspace}
config := worksexec.NewWorksExec(execConfig, workspaces)
// Use configuration to execute commands
// config.ForeachWorkRun(...)
}- workRoot: Workspace root DIR path
- projects: List of project paths included in this workspace
The main purpose of go-mate is to provide configuration file support when using the go-work package:
// Load configuration from JSON
workspace := workmate.NewWorkspace("config.json")
// Convert to go-work compatible format
goWorkspace := workspace.GetWorkspace()
// Use with go-work operations
config := worksexec.NewWorksExec(execConfig, []*workspace.Workspace{goWorkspace})type Workspace struct {
WorkRoot string `json:"workRoot"` // Workspace root DIR
Projects []string `json:"projects"` // Project paths in this workspace
}NewWorkspace(path string) *Workspace: Load workspace configuration from JSON fileGetWorkspace() *workspace.Workspace: Convert to go-work package compatible format
- Unified management of multiple Go project configurations
- Batch execution of cross-project commands
- Workspace-stage package management
- Configuration-driven project management
- Support of CI/CD pipeline configurations
- Simplified operations with complex project structures
- Collaboration with the mate ecosystem components
- Project configuration of IDEs and editors
- Support of rapid development environment switching
- Focused API design
- Focus on core configuration management functions
- Simple-to-understand and use interfaces
- Perfect integration with go-work package
- Support of mate ecosystem collaboration
- Standardized configuration format
- Flexible JSON configuration structure
- Support of future feature extensions
- Compatible-first design
MIT License. See LICENSE.
Contributions are welcome! Report bugs, suggest features, and contribute code:
- 🐛 Found a bug? Open an issue on GitHub with reproduction steps
- 💡 Have a feature idea? Create an issue to discuss the suggestion
- 📖 Documentation confusing? Report it so we can improve
- 🚀 Need new features? Share the use cases to help us understand requirements
- ⚡ Performance issue? Help us optimize through reporting slow operations
- 🔧 Configuration problem? Ask questions about complex setups
- 📢 Follow project progress? Watch the repo to get new releases and features
- 🌟 Success stories? Share how this package improved the workflow
- 💬 Feedback? We welcome suggestions and comments
New code contributions, follow this process:
- Fork: Fork the repo on GitHub (using the webpage UI).
- Clone: Clone the forked project (
git clone https://github.com/yourname/repo-name.git). - Navigate: Navigate to the cloned project (
cd repo-name) - Branch: Create a feature branch (
git checkout -b feature/xxx). - Code: Implement the changes with comprehensive tests
- Testing: (Golang project) Ensure tests pass (
go test ./...) and follow Go code style conventions - Documentation: Update documentation to support client-facing changes and use significant commit messages
- Stage: Stage changes (
git add .) - Commit: Commit changes (
git commit -m "Add feature xxx") ensuring backward compatible code - Push: Push to the branch (
git push origin feature/xxx). - PR: Open a pull request on GitHub (on the GitHub webpage) with detailed description.
Please ensure tests pass and include relevant documentation updates.
Welcome to contribute to this project via submitting merge requests and reporting issues.
Project Support:
- ⭐ Give GitHub stars if this project helps you
- 🤝 Share with teammates and (golang) programming friends
- 📝 Write tech blogs about development tools and workflows - we provide content writing support
- 🌟 Join the ecosystem - committed to supporting open source and the (golang) development scene
Have Fun Coding with this package! 🎉