@@ -14,14 +14,14 @@ type Response struct {
1414}
1515
1616func checkNotFoundResponse (data []byte ) bool {
17- l , err := unmarshalResponseList [interface {} ](data )
17+ l , err := unmarshalResponseList [any ](data )
1818 if err != nil {
1919 return false
2020 }
2121 return len (l ) == 0
2222}
2323
24- func unmarshalResponseObject [Obj interface {} ](data []byte ) (* Obj , error ) {
24+ func unmarshalResponseObject [Obj any ](data []byte ) (* Obj , error ) {
2525 // for some reason this api returns a 200 and empty list on some endpoints when the resource is not found
2626 emptyResp := checkNotFoundResponse (data )
2727 if emptyResp {
@@ -37,7 +37,7 @@ func unmarshalResponseObject[Obj interface{}](data []byte) (*Obj, error) {
3737 return obj , nil
3838}
3939
40- func unmarshalResponseList [Obj interface {} ](data []byte ) ([]Obj , error ) {
40+ func unmarshalResponseList [Obj any ](data []byte ) ([]Obj , error ) {
4141 body := io .NopCloser (bytes .NewReader (data ))
4242 defer body .Close ()
4343 objs := []Obj {}
@@ -49,7 +49,7 @@ func unmarshalResponseList[Obj interface{}](data []byte) ([]Obj, error) {
4949}
5050
5151// ResponseObject parses a http response and converts it to a generic object
52- func ResponseObject [Obj interface {} ](resp * Response ) (* Obj , error ) {
52+ func ResponseObject [Obj any ](resp * Response ) (* Obj , error ) {
5353 switch resp .StatusCode {
5454 case http .StatusOK :
5555 return unmarshalResponseObject [Obj ](resp .Data )
@@ -61,7 +61,7 @@ func ResponseObject[Obj interface{}](resp *Response) (*Obj, error) {
6161}
6262
6363// ResponseList parses a http response and converts it to a generic list of objects
64- func ResponseList [Obj interface {} ](resp * Response ) ([]Obj , error ) {
64+ func ResponseList [Obj any ](resp * Response ) ([]Obj , error ) {
6565 switch resp .StatusCode {
6666 case http .StatusOK :
6767 return unmarshalResponseList [Obj ](resp .Data )
0 commit comments