@@ -67,14 +67,12 @@ func TestCreateBookmark(t *testing.T) {
6767 // Labels should be split into an array
6868 if raw := payload ["labels" ]; raw == nil {
6969 t .Errorf ("expected labels to be set" )
70- } else {
71- if arr , ok := raw .([]any ); ok {
72- if len (arr ) != 2 || arr [0 ] != "tag1" || arr [1 ] != "tag2" {
73- t .Errorf ("unexpected labels: %#v" , arr )
74- }
75- } else {
76- t .Errorf ("labels should be an array, got %T" , raw )
70+ } else if arr , ok := raw .([]any ); ok {
71+ if len (arr ) != 2 || arr [0 ] != "tag1" || arr [1 ] != "tag2" {
72+ t .Errorf ("unexpected labels: %#v" , arr )
7773 }
74+ } else {
75+ t .Errorf ("labels should be an array, got %T" , raw )
7876 }
7977 w .WriteHeader (http .StatusOK )
8078 },
@@ -233,10 +231,8 @@ func TestCreateBookmark(t *testing.T) {
233231 if tt .errContains != "" && ! strings .Contains (err .Error (), tt .errContains ) {
234232 t .Fatalf ("expected error containing %q, got %q" , tt .errContains , err .Error ())
235233 }
236- } else {
237- if err != nil {
238- t .Fatalf ("unexpected error: %v" , err )
239- }
234+ } else if err != nil {
235+ t .Fatalf ("unexpected error: %v" , err )
240236 }
241237 })
242238 }
@@ -262,4 +258,3 @@ func TestNewClient(t *testing.T) {
262258 t .Errorf ("expected onlyURL %v, got %v" , onlyURL , c .onlyURL )
263259 }
264260}
265-
0 commit comments