mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
chore: format Go more aggressively
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
func TestAuditor(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var tests = []struct {
|
||||
tests := []struct {
|
||||
name string
|
||||
filterDecision audit.FilterDecision
|
||||
filterError error
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -21,9 +21,7 @@ import (
|
||||
"github.com/coder/coder/coderd/database"
|
||||
)
|
||||
|
||||
var (
|
||||
PubsubEvent = "replica"
|
||||
)
|
||||
var PubsubEvent = "replica"
|
||||
|
||||
type Options struct {
|
||||
ID uuid.UUID
|
||||
|
||||
Reference in New Issue
Block a user