Naming, layout and comments: descriptive full-word names, one item per line in wrapped calls and literals, and doc comments on exported names
Short and single-letter names in application code become full words (tests keep theirs). Wrapped calls, signatures and composite literals put one item per line, and one-line function bodies are expanded. Exported names and groups of constants get doc comments, and comments refer to the renamed identifiers.
This commit is contained in:
1 parent
043e307663
commit
465358609a
78 files changed
+2374
-1402
No files matched your search
@@ -16,7 +16,9 @@ import (
|
||||
|
||||
func result(path, direction string) *goose.MigrationResult {
|
||||
return &goose.MigrationResult{
|
||||
Source: &goose.Source{Path: "migrations/" + path},
|
||||
Source: &goose.Source{
|
||||
Path: "migrations/" + path,
|
||||
},
|
||||
Direction: direction,
|
||||
Duration: 1500 * time.Microsecond,
|
||||
}
|
||||
@@ -45,7 +47,9 @@ func TestFailurePartial(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFailureWithoutFailedSource(t *testing.T) {
|
||||
err := failure(&bytes.Buffer{}, &goose.PartialError{Err: errors.New("boom")})
|
||||
err := failure(&bytes.Buffer{}, &goose.PartialError{
|
||||
Err: errors.New("boom"),
|
||||
})
|
||||
if err == nil || !strings.Contains(err.Error(), "unknown migration") {
|
||||
t.Errorf("err = %v, want unknown migration", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user