After sync.Once successfully runs the function with Do(f) , it marks itself as “complete” internally with a flag ( done ), and from that point on, any further calls to Do(f) won’t run the function again, even if it’s a different function. Once var config Config var err error func GetConfig () ( Config , error ) { var err error once . Println ( "Loading config..." ) return fetchConfig () // Pretend this is expensive }) func main () { config1 := getConfigOnce () // Loading config... config2 := getConfigOnce () // No print, just returns the cached config ... } // Output: // Loading config...