Skip to content
Merged
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
Prev Previous commit
Next Next commit
fix nits
  • Loading branch information
johnstcn committed Jan 18, 2023
commit 3ebb778a145f12495b62cfa2db14bd5c85541f46
2 changes: 2 additions & 0 deletions coderd/experiments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func Test_Experiments(t *testing.T) {
t.Run("Unauthorized", func(t *testing.T) {
t.Setenv("CODER_EXPERIMENTAL", "foo,bar")
client := coderdtest.New(t, nil)
// Explicitly omit creating a user so we're unauthorized.
// _ = coderdtest.CreateFirstUser(t, client)

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
Expand Down
4 changes: 2 additions & 2 deletions codersdk/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func (e Experiments) Enabled(ex string) bool {
func (c *Client) Experiments(ctx context.Context) (Experiments, error) {
res, err := c.Request(ctx, http.MethodGet, "/api/v2/experiments", nil)
if err != nil {
return []string{}, err
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return []string{}, readBodyAsError(res)
return nil, readBodyAsError(res)
}
var exp []string
return exp, json.NewDecoder(res.Body).Decode(&exp)
Expand Down