package main

import "fmt"

// section: types
type UserID int
type ProductID int
type Score float64
// section: types

// section: constraint
type IntegerID interface {
	~int
}

type FloatScore interface {
	~float64
}
// section: constraint

func main() {
	// section: usage
	processID := func[T IntegerID](id T) {
		fmt.Printf("Processing ID: %v\n", id)
	}
	
	processScore := func[T FloatScore](score T) {
		fmt.Printf("Processing score: %.2f\n", score)
	}
	
	var userID UserID = 123
	var productID ProductID = 456
	var score Score = 95.5
	
	processID(userID)
	processID(productID)
	processScore(score)
	// section: usage
} 