You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Helper function to capitalize the first letter of a string.
func capitalizeManufacturer(manufacturer string) string {
if len(manufacturer) == 0 {
return manufacturer
}
return strings.ToUpper(manufacturer[:1]) + strings.ToLower(manufacturer[1:])
}
// Read one-liner text files, strip newline.
func slurpFile(path string) string {
data, err := os.ReadFile(path)
if err != nil {
return ""
}
return strings.TrimSpace(string(data))
}
// If a deferred function has any return values, they are discarded when the function completes.
func Check(f func() error) {
if err := f(); err != nil {
fmt.Println("Received error:", err)
}
}
The text was updated successfully, but these errors were encountered:
Write common lib for:
The text was updated successfully, but these errors were encountered: