See how Boundary would look with gofumpt applied (#853)

* See how Boundary would look with https://github.com/mvdan/gofumpt applied

Results of running `gofumpt -w -s .`

* Update tools file and Makefile for gofumpt

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
This commit is contained in:
Michael GaffneyandJeff Mitchell authored and GitHub committed 2021-01-07 10:02:32 -05:00
1 parent cca0fbea2b
commit 94cb79bbdd
237 files changed
+1567 -1529

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ import (
func StartMemProfiler(logger hclog.Logger) {
profileDir := filepath.Join(os.TempDir(), "boundaryprof")
if err := os.MkdirAll(profileDir, 0700); err != nil {
if err := os.MkdirAll(profileDir, 0o700); err != nil {
logger.Debug("could not create profile directory", "error", err)
return
}
+2 -2
View File
@@ -159,7 +159,7 @@ func (b *Server) StorePidFile(pidPath string) error {
}
// Open the PID file
pidFile, err := os.OpenFile(pidPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
pidFile, err := os.OpenFile(pidPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644)
if err != nil {
return fmt.Errorf("could not open pid file: %w", err)
}
@@ -313,7 +313,7 @@ func (b *Server) SetupListeners(ui cli.Ui, config *configutil.SharedConfig, allo
lnConfig.MaxRequestSize = globals.DefaultMaxRequestSize
}
// TODO: We don't actually limit this yet.
//props["max_request_size"] = fmt.Sprintf("%d", lnConfig.MaxRequestSize)
// props["max_request_size"] = fmt.Sprintf("%d", lnConfig.MaxRequestSize)
if lnConfig.MaxRequestDuration == 0 {
lnConfig.MaxRequestDuration = globals.DefaultMaxRequestDuration
+4 -2
View File
@@ -17,8 +17,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -16,8 +16,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*PasswordCommand)(nil)
var _ cli.CommandAutocomplete = (*PasswordCommand)(nil)
var (
_ cli.Command = (*PasswordCommand)(nil)
_ cli.CommandAutocomplete = (*PasswordCommand)(nil)
)
type PasswordCommand struct {
*base.Command
@@ -20,12 +20,16 @@ import (
zkeyring "github.com/zalando/go-keyring"
)
var _ cli.Command = (*PasswordCommand)(nil)
var _ cli.CommandAutocomplete = (*PasswordCommand)(nil)
var (
_ cli.Command = (*PasswordCommand)(nil)
_ cli.CommandAutocomplete = (*PasswordCommand)(nil)
)
var envPassword = "BOUNDARY_AUTHENTICATE_PASSWORD_PASSWORD"
var envLoginName = "BOUNDARY_AUTHENTICATE_PASSWORD_LOGIN_NAME"
var envAuthMethodId = "BOUNDARY_AUTHENTICATE_AUTH_METHOD_ID"
var (
envPassword = "BOUNDARY_AUTHENTICATE_PASSWORD_PASSWORD"
envLoginName = "BOUNDARY_AUTHENTICATE_PASSWORD_LOGIN_NAME"
envAuthMethodId = "BOUNDARY_AUTHENTICATE_AUTH_METHOD_ID"
)
type PasswordCommand struct {
*base.Command
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*PasswordCommand)(nil)
var _ cli.CommandAutocomplete = (*PasswordCommand)(nil)
var (
_ cli.Command = (*PasswordCommand)(nil)
_ cli.CommandAutocomplete = (*PasswordCommand)(nil)
)
type PasswordCommand struct {
*base.Command
@@ -15,8 +15,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*EncryptDecryptCommand)(nil)
var _ cli.CommandAutocomplete = (*EncryptDecryptCommand)(nil)
var (
_ cli.Command = (*EncryptDecryptCommand)(nil)
_ cli.CommandAutocomplete = (*EncryptDecryptCommand)(nil)
)
type EncryptDecryptCommand struct {
*base.Command
@@ -61,7 +61,6 @@ func TestEncryptDecrypt(t *testing.T) {
for _, c := range cases {
t.Run(fmt.Sprintf("Test encrypt %v", c.f), func(t *testing.T) {
var b bytes.Buffer
ui := &cli.BasicUi{
+4 -2
View File
@@ -9,8 +9,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*TokenCommand)(nil)
var _ cli.CommandAutocomplete = (*TokenCommand)(nil)
var (
_ cli.Command = (*TokenCommand)(nil)
_ cli.CommandAutocomplete = (*TokenCommand)(nil)
)
type TokenCommand struct {
*base.Command
+4 -4
View File
@@ -56,8 +56,10 @@ type TerminationInfo struct {
Reason string `json:"termination_reason"`
}
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
@@ -648,7 +650,6 @@ func (c *Command) getWsConn(
ctx context.Context,
workerAddr string,
transport *http.Transport) (*websocket.Conn, error) {
conn, resp, err := websocket.Dial(
ctx,
fmt.Sprintf("wss://%s/v1/proxy", workerAddr),
@@ -687,7 +688,6 @@ func (c *Command) sendSessionTeardown(
ctx context.Context,
wsConn *websocket.Conn,
tofuToken string) error {
handshake := proxy.ClientHandshake{
TofuToken: tofuToken,
Command: proxy.HANDSHAKECOMMAND_HANDSHAKECOMMAND_SESSION_CANCEL,
+4 -2
View File
@@ -6,8 +6,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -18,8 +18,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*InitCommand)(nil)
var _ cli.CommandAutocomplete = (*InitCommand)(nil)
var (
_ cli.Command = (*InitCommand)(nil)
_ cli.CommandAutocomplete = (*InitCommand)(nil)
)
type InitCommand struct {
*base.Command
+5 -3
View File
@@ -21,8 +21,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Server
@@ -241,7 +243,7 @@ func (c *Command) Run(args []string) int {
return 1
}
//childShutdownCh := make(chan struct{})
// childShutdownCh := make(chan struct{})
c.Config, err = config.DevCombined()
if err != nil {
+4 -2
View File
@@ -13,8 +13,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -13,8 +13,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*StaticCommand)(nil)
var _ cli.CommandAutocomplete = (*StaticCommand)(nil)
var (
_ cli.Command = (*StaticCommand)(nil)
_ cli.CommandAutocomplete = (*StaticCommand)(nil)
)
type StaticCommand struct {
*base.Command
+4 -2
View File
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -13,8 +13,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*StaticCommand)(nil)
var _ cli.CommandAutocomplete = (*StaticCommand)(nil)
var (
_ cli.Command = (*StaticCommand)(nil)
_ cli.CommandAutocomplete = (*StaticCommand)(nil)
)
type StaticCommand struct {
*base.Command
+4 -2
View File
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -13,8 +13,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*StaticCommand)(nil)
var _ cli.CommandAutocomplete = (*StaticCommand)(nil)
var (
_ cli.Command = (*StaticCommand)(nil)
_ cli.CommandAutocomplete = (*StaticCommand)(nil)
)
type StaticCommand struct {
*base.Command
-1
View File
@@ -138,7 +138,6 @@ func generateRoleTableOutput(in *roles.Role) string {
ret = append(ret,
fmt.Sprintf(" %s", grant.Canonical),
)
}
return base.WrapForHelpText(ret)
}
+4 -2
View File
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -20,8 +20,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Server
+4 -2
View File
@@ -14,8 +14,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -15,8 +15,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -15,8 +15,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*TcpCommand)(nil)
var _ cli.CommandAutocomplete = (*TcpCommand)(nil)
var (
_ cli.Command = (*TcpCommand)(nil)
_ cli.CommandAutocomplete = (*TcpCommand)(nil)
)
type TcpCommand struct {
*base.Command
+4 -2
View File
@@ -13,8 +13,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command
+4 -2
View File
@@ -9,8 +9,10 @@ import (
"github.com/posener/complete"
)
var _ cli.Command = (*Command)(nil)
var _ cli.CommandAutocomplete = (*Command)(nil)
var (
_ cli.Command = (*Command)(nil)
_ cli.CommandAutocomplete = (*Command)(nil)
)
type Command struct {
*base.Command