Configuration Parsing
Parse NuGet.Config files from files, strings, or io.Reader with comprehensive error handling.
Parse, manipulate, and manage NuGet configuration files with ease
package main
import (
"fmt"
"log"
"github.com/scagogogo/nuget-config-parser/pkg/nuget"
)
func main() {
// Create API instance
api := nuget.NewAPI()
// Find and parse configuration
config, configPath, err := api.FindAndParseConfig()
if err != nil {
log.Fatalf("Failed to find config: %v", err)
}
// Display package sources
fmt.Printf("Config file: %s\n", configPath)
fmt.Printf("Package sources: %d\n", len(config.PackageSources.Add))
for _, source := range config.PackageSources.Add {
fmt.Printf("- %s: %s\n", source.Key, source.Value)
}
}
go get github.com/scagogogo/nuget-config-parser
Simple, intuitive API that follows Go best practices and conventions.
Supports all major NuGet configuration features including package sources, credentials, and global settings.
Extensive documentation with examples for every feature and use case.
Battle-tested with comprehensive test coverage and error handling.