Skip to content

Commit a46218c

Browse files
Added all git contexs types support
1 parent 5ecbab4 commit a46218c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pkg/codefresh/contexts.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package codefresh
22

3-
import "github.com/codefresh-io/go-sdk/pkg/utils"
3+
import (
4+
"encoding/json"
5+
)
46

57
type (
68
IContextAPI interface {
@@ -54,7 +56,8 @@ func (c context) GetGitContexts() (error, *[]ContextPayload) {
5456
Decrypt: "true",
5557
}
5658

57-
utils.Convert(gitContextsQs, &qs)
59+
rs, _ := json.Marshal(gitContextsQs)
60+
_ = json.Unmarshal(rs, &qs)
5861

5962
resp, err := c.codefresh.requestAPI(&requestOptions{
6063
method: "GET",

pkg/utils/utils.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package utils
22

33
import (
4-
"encoding/json"
54
"fmt"
65

76
"github.com/codefresh-io/go-sdk/internal"
@@ -15,8 +14,3 @@ func CastToCodefreshOrDie(candidate interface{}) codefresh.Codefresh {
1514
}
1615
return client
1716
}
18-
19-
func Convert(from interface{}, to interface{}) {
20-
rs, _ := json.Marshal(from)
21-
_ = json.Unmarshal(rs, to)
22-
}

0 commit comments

Comments
 (0)