// cmd/lab/main.go
package main

import (
	"fmt"
	"sync"

	"example.com/gohawk-lab/internal/metrics"
)

var mu sync.Mutex
var unhealthy bool

// update locks mu, then returns early on the unhealthy path without
// unlocking: the next caller deadlocks.
func update() {
	mu.Lock()
	if unhealthy {
		return
	}
	fmt.Println("updated")
	mu.Unlock()
}

func main() {
	_, _ = metrics.FileSize("/etc/hosts")
	update()
}
