mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-13 08:03:33 +02:00
gofmt
This commit is contained in:
@@ -101,9 +101,9 @@ func (c *Cli) CmdList() error {
|
|||||||
query = qbuff.String()
|
query = qbuff.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
fields := make([]string,0)
|
fields := make([]string, 0)
|
||||||
if qf, ok := c.opts["queryfields"]; ok {
|
if qf, ok := c.opts["queryfields"]; ok {
|
||||||
fields = strings.Split(qf,",")
|
fields = strings.Split(qf, ",")
|
||||||
} else {
|
} else {
|
||||||
fields = append(fields, "summary")
|
fields = append(fields, "summary")
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ func (c *Cli) CmdList() error {
|
|||||||
"jql": query,
|
"jql": query,
|
||||||
"startAt": "0",
|
"startAt": "0",
|
||||||
"maxResults": "500",
|
"maxResults": "500",
|
||||||
"fields": fields,
|
"fields": fields,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -480,8 +480,8 @@ func (c *Cli) CmdTransition(issue string, trans string) error {
|
|||||||
issueData["overrides"] = c.opts
|
issueData["overrides"] = c.opts
|
||||||
issueData["transition"] = map[string]interface{}{
|
issueData["transition"] = map[string]interface{}{
|
||||||
"name": transName,
|
"name": transName,
|
||||||
"id": transId,
|
"id": transId,
|
||||||
};
|
}
|
||||||
|
|
||||||
return c.editTemplate(
|
return c.editTemplate(
|
||||||
c.getTemplate("transition"),
|
c.getTemplate("transition"),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const default_debug_template = "{{ . | toJson}}\n"
|
|||||||
|
|
||||||
const default_list_template = "{{ range .issues }}{{ .key | append \":\" | printf \"%-12s\"}} {{ .fields.summary }}\n{{ end }}"
|
const default_list_template = "{{ range .issues }}{{ .key | append \":\" | printf \"%-12s\"}} {{ .fields.summary }}\n{{ end }}"
|
||||||
|
|
||||||
const default_table_template =`+{{ "-" | rep 16 }}+{{ "-" | rep 57 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
|
const default_table_template = `+{{ "-" | rep 16 }}+{{ "-" | rep 57 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
|
||||||
| {{ "Issue" | printf "%-14s" }} | {{ "Summary" | printf "%-55s" }} | {{ "Priority" | printf "%-12s" }} | {{ "Status" | printf "%-12s" }} | {{ "Age" | printf "%-10s" }} | {{ "Reporter" | printf "%-12s" }} | {{ "Assignee" | printf "%-12s" }} |
|
| {{ "Issue" | printf "%-14s" }} | {{ "Summary" | printf "%-55s" }} | {{ "Priority" | printf "%-12s" }} | {{ "Status" | printf "%-12s" }} | {{ "Age" | printf "%-10s" }} | {{ "Reporter" | printf "%-12s" }} | {{ "Assignee" | printf "%-12s" }} |
|
||||||
+{{ "-" | rep 16 }}+{{ "-" | rep 57 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
|
+{{ "-" | rep 16 }}+{{ "-" | rep 57 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+{{ "-" | rep 12 }}+{{ "-" | rep 14 }}+{{ "-" | rep 14 }}+
|
||||||
{{ range .issues }}| {{ .key | printf "%-14s"}} | {{ .fields.summary | abbrev 55 | printf "%-55s" }} | {{.fields.priority.name | printf "%-12s" }} | {{.fields.status.name | printf "%-12s" }} | {{.fields.created | age | printf "%-10s" }} | {{.fields.reporter.name | printf "%-12s"}} | {{if .fields.assignee }}{{.fields.assignee.name | printf "%-12s" }}{{else}}<unassigned>{{end}} |
|
{{ range .issues }}| {{ .key | printf "%-14s"}} | {{ .fields.summary | abbrev 55 | printf "%-55s" }} | {{.fields.priority.name | printf "%-12s" }} | {{.fields.status.name | printf "%-12s" }} | {{.fields.created | age | printf "%-10s" }} | {{.fields.reporter.name | printf "%-12s"}} | {{if .fields.assignee }}{{.fields.assignee.name | printf "%-12s" }}{{else}}<unassigned>{{end}} |
|
||||||
|
|||||||
+2
-3
@@ -79,7 +79,7 @@ func fuzzyAge(start string) (string, error) {
|
|||||||
} else if dh := delta.Hours(); dh < 48 {
|
} else if dh := delta.Hours(); dh < 48 {
|
||||||
return "a day", nil
|
return "a day", nil
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("%d days", int(delta.Hours() / 24)), nil
|
return fmt.Sprintf("%d days", int(delta.Hours()/24)), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "unknown", nil
|
return "unknown", nil
|
||||||
@@ -163,13 +163,12 @@ func responseToJson(resp *http.Response, err error) (interface{}, error) {
|
|||||||
data := jsonDecode(resp.Body)
|
data := jsonDecode(resp.Body)
|
||||||
if resp.StatusCode == 400 {
|
if resp.StatusCode == 400 {
|
||||||
if val, ok := data.(map[string]interface{})["errorMessages"]; ok {
|
if val, ok := data.(map[string]interface{})["errorMessages"]; ok {
|
||||||
for _,errMsg := range val.([]interface{}) {
|
for _, errMsg := range val.([]interface{}) {
|
||||||
log.Error("%s", errMsg)
|
log.Error("%s", errMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -345,7 +345,7 @@ func loadConfigs(opts map[string]string) {
|
|||||||
for _, file := range paths {
|
for _, file := range paths {
|
||||||
if stat, err := os.Stat(file); err == nil {
|
if stat, err := os.Stat(file); err == nil {
|
||||||
// check to see if config file is exectuable
|
// check to see if config file is exectuable
|
||||||
if stat.Mode() & 0111 == 0 {
|
if stat.Mode()&0111 == 0 {
|
||||||
parseYaml(file, opts)
|
parseYaml(file, opts)
|
||||||
} else {
|
} else {
|
||||||
log.Debug("Found Executable Config file: %s", file)
|
log.Debug("Found Executable Config file: %s", file)
|
||||||
|
|||||||
Reference in New Issue
Block a user