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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user