diff --git a/shuttletask/format.go b/shuttletask/format.go index 4556fb8..126b8e9 100644 --- a/shuttletask/format.go +++ b/shuttletask/format.go @@ -18,7 +18,7 @@ type Opts struct { type OptsFunc func(ctx context.Context, o *Opts) error -func WithPath(path string) OptsFunc { +func withPath(path string) OptsFunc { return func(ctx context.Context, o *Opts) error { o.Path = path @@ -26,7 +26,7 @@ func WithPath(path string) OptsFunc { } } -func Format(ctx context.Context, optsFuncs ...OptsFunc) error { +func format(ctx context.Context, optsFuncs ...OptsFunc) error { opts := &Opts{ Path: ".", IgnoredFiles: []string{ @@ -74,3 +74,7 @@ func Format(ctx context.Context, optsFuncs ...OptsFunc) error { return nil } + +func Format(ctx context.Context) error { + return format(ctx) +} diff --git a/shuttletask/format_test.go b/shuttletask/format_test.go index 211ec99..59eeb7e 100644 --- a/shuttletask/format_test.go +++ b/shuttletask/format_test.go @@ -14,7 +14,7 @@ func TestCompile(t *testing.T) { t.Run("With testdata", func(t *testing.T) { ctx := context.Background() - err := Format(ctx, WithPath("testdata/test_module")) + err := format(ctx, withPath("testdata/test_module")) assert.NoError(t, err) file, err := os.ReadFile("testdata/test_module/very_long_line.go")