you forgot the return. fmt.Errorf as not effect on its own.