chore: format Go more aggressively

This commit is contained in:
Ammar Bandukwala
2023-02-18 18:32:09 -06:00
committed by GitHub
parent 19ae411f05
commit f05609b4da
97 changed files with 411 additions and 413 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ import (
func TestAuditor(t *testing.T) {
t.Parallel()
var tests = []struct {
tests := []struct {
name string
filterDecision audit.FilterDecision
filterError error
+1 -3
View File
@@ -47,9 +47,7 @@ func diffValues(left, right any, table Table) audit.Map {
rightI = rightF.Interface()
)
var (
diffName = field.FieldType.Tag.Get("json")
)
diffName := field.FieldType.Tag.Get("json")
atype, ok := diffKey[diffName]
if !ok {
+2 -6
View File
@@ -13,17 +13,13 @@ import (
)
func groupCreate() *cobra.Command {
var (
avatarURL string
)
var avatarURL string
cmd := &cobra.Command{
Use: "create <name>",
Short: "Create a user group",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
var (
ctx = cmd.Context()
)
ctx := cmd.Context()
client, err := agpl.CreateClient(cmd)
if err != nil {
+1 -3
View File
@@ -49,9 +49,7 @@ func TestGroupEdit(t *testing.T) {
})
require.NoError(t, err)
var (
expectedName = "beta"
)
expectedName := "beta"
cmd, root := clitest.NewWithSubcommands(t, cli.EnterpriseSubcommands(),
"groups", "edit", group.Name,
+1 -3
View File
@@ -24,9 +24,7 @@ func groupList() *cobra.Command {
Short: "List user groups",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var (
ctx = cmd.Context()
)
ctx := cmd.Context()
client, err := agpl.CreateClient(cmd)
if err != nil {
+2 -1
View File
@@ -67,7 +67,8 @@ func TestGroupList(t *testing.T) {
err = cmd.Execute()
require.NoError(t, err)
matches := []string{"NAME", "ORGANIZATION ID", "MEMBERS", " AVATAR URL",
matches := []string{
"NAME", "ORGANIZATION ID", "MEMBERS", " AVATAR URL",
group2.Name, group2.OrganizationID.String(), user2.Email, group2.AvatarURL,
group1.Name, group1.OrganizationID.String(), user1.Email, group1.AvatarURL,
}
+5 -3
View File
@@ -28,8 +28,10 @@ import (
"github.com/coder/coder/testutil"
)
const fakeLicenseJWT = "test.jwt.sig"
const testWarning = "This is a test warning"
const (
fakeLicenseJWT = "test.jwt.sig"
testWarning = "This is a test warning"
)
func TestLicensesAddFake(t *testing.T) {
t.Parallel()
@@ -69,7 +71,7 @@ func TestLicensesAddFake(t *testing.T) {
defer cancel()
dir := t.TempDir()
filename := filepath.Join(dir, "license.jwt")
err := os.WriteFile(filename, []byte(fakeLicenseJWT), 0600)
err := os.WriteFile(filename, []byte(fakeLicenseJWT), 0o600)
require.NoError(t, err)
cmd := setupFakeLicenseServerTest(t, "license", "add", "-f", filename)
pty := attachPty(t, cmd)
+1 -3
View File
@@ -21,9 +21,7 @@ import (
"github.com/coder/coder/coderd/database"
)
var (
PubsubEvent = "replica"
)
var PubsubEvent = "replica"
type Options struct {
ID uuid.UUID