Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seperate cli and cmd main package #564

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,698 changes: 5 additions & 1,693 deletions cmd/bbolt/main.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cmd/bbolt/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require"

bolt "go.etcd.io/bbolt"
main "go.etcd.io/bbolt/cmd/bbolt"
"go.etcd.io/bbolt/cmd/cli"
"go.etcd.io/bbolt/internal/guts_cli"
)

Expand Down Expand Up @@ -441,15 +441,15 @@ func (b *ConcurrentBuffer) String() string {

// Main represents a test wrapper for main.Main that records output.
type Main struct {
*main.Main
*cli.Main
Stdin ConcurrentBuffer
Stdout ConcurrentBuffer
Stderr ConcurrentBuffer
}

// NewMain returns a new instance of Main.
func NewMain() *Main {
m := &Main{Main: main.NewMain()}
m := &Main{Main: cli.NewMain()}
m.Main.Stdin = &m.Stdin
m.Main.Stdout = &m.Stdout
m.Main.Stderr = &m.Stderr
Expand Down
2 changes: 1 addition & 1 deletion cmd/bbolt/command_root.go → cmd/cli/command_root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"github.com/spf13/cobra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main_test
package cli_test

import (
"path/filepath"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"

bolt "go.etcd.io/bbolt"
main "go.etcd.io/bbolt/cmd/bbolt"
main "go.etcd.io/bbolt/cmd/cli"
"go.etcd.io/bbolt/internal/btesting"
"go.etcd.io/bbolt/internal/common"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main_test
package cli_test

import (
"fmt"
Expand All @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"

bolt "go.etcd.io/bbolt"
main "go.etcd.io/bbolt/cmd/bbolt"
main "go.etcd.io/bbolt/cmd/cli"
"go.etcd.io/bbolt/internal/btesting"
"go.etcd.io/bbolt/internal/common"
"go.etcd.io/bbolt/internal/guts_cli"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"fmt"
Expand Down
Loading
Loading