1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-11-27 22:18:45 +02:00

Instead of baking config into the client, adds a method call that allows options to be passed in

This commit is contained in:
spmassot
2018-10-17 15:17:08 -04:00
parent 00a32a0fd7
commit 9049c9ff74
10 changed files with 62 additions and 104 deletions

View File

@@ -29,10 +29,7 @@ func main() {
Password: strings.TrimSpace(password),
}
config = jira.ServiceConfig{
Notify: true,
}
client, err := jira.NewClient(tp.Client(), strings.TrimSpace(jiraURL), config)
client, err := jira.NewClient(tp.Client(), strings.TrimSpace(jiraURL))
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return

View File

@@ -29,10 +29,7 @@ func main() {
Password: strings.TrimSpace(password),
}
config = jira.ServiceConfig{
Notify: true,
}
client, err := jira.NewClient(tp.Client(), strings.TrimSpace(jiraURL), config)
client, err := jira.NewClient(tp.Client(), strings.TrimSpace(jiraURL))
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return

View File

@@ -7,10 +7,7 @@ import (
)
func main() {
config = jira.ServiceConfig{
Notify: true,
}
jiraClient, _ := jira.NewClient(nil, "https://jira.atlassian.com/", config)
jiraClient, _ := jira.NewClient(nil, "https://jira.atlassian.com/")
req, _ := jiraClient.NewRequest("GET", "/rest/api/2/project", nil)
projects := new([]jira.Project)

View File

@@ -14,10 +14,7 @@ func main() {
}
client := &http.Client{Transport: tr}
config = jira.ServiceConfig{
Notify: true,
}
jiraClient, _ := jira.NewClient(client, "https://issues.apache.org/jira/", config)
jiraClient, _ := jira.NewClient(client, "https://issues.apache.org/jira/")
issue, _, _ := jiraClient.Issue.Get("MESOS-3325", nil)
fmt.Printf("%s: %+v\n", issue.Key, issue.Fields.Summary)

View File

@@ -7,10 +7,7 @@ import (
)
func main() {
config = jira.ServiceConfig{
Notify: true,
}
jiraClient, _ := jira.NewClient(nil, "https://issues.apache.org/jira/", config)
jiraClient, _ := jira.NewClient(nil, "https://issues.apache.org/jira/")
issue, _, _ := jiraClient.Issue.Get("MESOS-3325", nil)
fmt.Printf("%s: %+v\n", issue.Key, issue.Fields.Summary)

View File

@@ -42,10 +42,7 @@ func main() {
tp = ba.Client()
}
config = jira.ServiceConfig{
Notify: true,
}
client, err := jira.NewClient(tp, strings.TrimSpace(jiraURL), config)
client, err := jira.NewClient(tp, strings.TrimSpace(jiraURL))
if err != nil {
fmt.Printf("\nerror: %v\n", err)
return