package main

import (
	"fmt"
	"path/filepath"
	"strings"
)

func kind(file string) string {
	switch strings.ToLower(filepath.Ext(file)) {
	case ".jpg", ".png":
		return "photo"
	case ".mov", ".mp4":
		return "film"
	case "":
		return "no ending"
	default:
		return "other"
	}
}

func main() {
	for _, file := range []string{"beach.JPG", "trip.mp4", "notes.txt", "README"} {
		fmt.Printf("%-10s %s\n", file, kind(file))
	}

	free := 12
	switch { // without a value, the first true case wins
	case free < 5:
		fmt.Println("critical")
	case free < 20:
		fmt.Println("low")
	default:
		fmt.Println("fine")
	}
}
