mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Fix issues found by goimports
Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
parent
d45c02251d
commit
b7165991c9
@ -7,9 +7,9 @@ import (
|
|||||||
"github.com/wtfutil/wtf/modules/bamboohr"
|
"github.com/wtfutil/wtf/modules/bamboohr"
|
||||||
"github.com/wtfutil/wtf/modules/bargraph"
|
"github.com/wtfutil/wtf/modules/bargraph"
|
||||||
"github.com/wtfutil/wtf/modules/buildkite"
|
"github.com/wtfutil/wtf/modules/buildkite"
|
||||||
"github.com/wtfutil/wtf/modules/cds/favorites"
|
cdsfavorites "github.com/wtfutil/wtf/modules/cds/favorites"
|
||||||
"github.com/wtfutil/wtf/modules/cds/queue"
|
cdsqueue "github.com/wtfutil/wtf/modules/cds/queue"
|
||||||
"github.com/wtfutil/wtf/modules/cds/status"
|
cdsstatus "github.com/wtfutil/wtf/modules/cds/status"
|
||||||
"github.com/wtfutil/wtf/modules/circleci"
|
"github.com/wtfutil/wtf/modules/circleci"
|
||||||
"github.com/wtfutil/wtf/modules/clocks"
|
"github.com/wtfutil/wtf/modules/clocks"
|
||||||
"github.com/wtfutil/wtf/modules/cmdrunner"
|
"github.com/wtfutil/wtf/modules/cmdrunner"
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package checklist
|
package checklist
|
||||||
|
|
||||||
import ()
|
|
||||||
|
|
||||||
// ChecklistItem is a module for creating generic checklist implementations
|
// ChecklistItem is a module for creating generic checklist implementations
|
||||||
// See 'Todo' for an implementation example
|
// See 'Todo' for an implementation example
|
||||||
type ChecklistItem struct {
|
type ChecklistItem struct {
|
||||||
|
@ -46,14 +46,14 @@ func main() {
|
|||||||
|
|
||||||
/* -------------------- Unexported Functions -------------------- */
|
/* -------------------- Unexported Functions -------------------- */
|
||||||
|
|
||||||
func createModuleDirectory(data struct { Name string }) {
|
func createModuleDirectory(data struct{ Name string }) {
|
||||||
err := os.MkdirAll(strings.ToLower(fmt.Sprintf("modules/%s", data.Name)), os.ModePerm)
|
err := os.MkdirAll(strings.ToLower(fmt.Sprintf("modules/%s", data.Name)), os.ModePerm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateWidgetFile(data struct { Name string }) {
|
func generateWidgetFile(data struct{ Name string }) {
|
||||||
tpl, _ := template.New("textwidget.tpl").Funcs(template.FuncMap{
|
tpl, _ := template.New("textwidget.tpl").Funcs(template.FuncMap{
|
||||||
"Lower": strings.ToLower,
|
"Lower": strings.ToLower,
|
||||||
}).ParseFiles("generator/textwidget.tpl")
|
}).ParseFiles("generator/textwidget.tpl")
|
||||||
@ -67,8 +67,8 @@ func generateWidgetFile(data struct { Name string }) {
|
|||||||
tpl.Execute(out, data)
|
tpl.Execute(out, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateSettingsFile(data struct { Name string }) {
|
func generateSettingsFile(data struct{ Name string }) {
|
||||||
tpl, _ := template.New("settings.tpl").Funcs(template.FuncMap{
|
tpl, _ := template.New("settings.tpl").Funcs(template.FuncMap{
|
||||||
"Lower": strings.ToLower,
|
"Lower": strings.ToLower,
|
||||||
}).ParseFiles("generator/settings.tpl")
|
}).ParseFiles("generator/settings.tpl")
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package buildkite
|
package buildkite
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/olebedev/config"
|
"github.com/olebedev/config"
|
||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -2,6 +2,7 @@ package buildkite
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
@ -12,10 +12,9 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
pullRequestsPath = "/pulls"
|
pullRequestsPath = "/pulls"
|
||||||
issuesPath = "/issues"
|
issuesPath = "/issues"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
// GithubRepo defines a new GithubRepo structure
|
// GithubRepo defines a new GithubRepo structure
|
||||||
type GithubRepo struct {
|
type GithubRepo struct {
|
||||||
apiKey string
|
apiKey string
|
||||||
|
@ -45,7 +45,7 @@ func (widget *Widget) Create(jenkinsURL string, username string, apiKey string)
|
|||||||
return view, err
|
return view, err
|
||||||
}
|
}
|
||||||
|
|
||||||
respJobs := make([]Job, 0, len(view.Jobs) + len(view.ActiveConfigurations))
|
respJobs := make([]Job, 0, len(view.Jobs)+len(view.ActiveConfigurations))
|
||||||
respJobs = append(append(respJobs, view.Jobs...), view.ActiveConfigurations...)
|
respJobs = append(append(respJobs, view.Jobs...), view.ActiveConfigurations...)
|
||||||
|
|
||||||
jobs := make([]Job, 0)
|
jobs := make([]Job, 0)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package jenkins
|
package jenkins
|
||||||
|
|
||||||
type View struct {
|
type View struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Jobs []Job `json:"jobs"`
|
Jobs []Job `json:"jobs"`
|
||||||
ActiveConfigurations []Job `json:"activeConfigurations"`
|
ActiveConfigurations []Job `json:"activeConfigurations"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,11 @@ package jenkins
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
"net/url"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
|
@ -12,7 +12,7 @@ type Issue struct {
|
|||||||
type IssueFields struct {
|
type IssueFields struct {
|
||||||
Summary string `json:"summary"`
|
Summary string `json:"summary"`
|
||||||
|
|
||||||
IssueType *IssueType `json:"issuetype"`
|
IssueType *IssueType `json:"issuetype"`
|
||||||
IssueStatus *IssueStatus `json:"status"`
|
IssueStatus *IssueStatus `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ type IssueType struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IssueStatus struct {
|
type IssueStatus struct {
|
||||||
ISelf string `json:"self"`
|
ISelf string `json:"self"`
|
||||||
IDescription string `json:"description"`
|
IDescription string `json:"description"`
|
||||||
IName string `json:"name"`
|
IName string `json:"name"`
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package spacex
|
package spacex
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/wtfutil/wtf/utils"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/wtfutil/wtf/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -44,16 +44,16 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.links = nil
|
widget.links = nil
|
||||||
widget.SetItemCount(0)
|
widget.SetItemCount(0)
|
||||||
} else {
|
} else {
|
||||||
if len(links) <= widget.settings.numberOfPosts {
|
if len(links) <= widget.settings.numberOfPosts {
|
||||||
widget.links = links
|
widget.links = links
|
||||||
widget.SetItemCount(len(widget.links))
|
widget.SetItemCount(len(widget.links))
|
||||||
widget.err = nil
|
widget.err = nil
|
||||||
} else {
|
} else {
|
||||||
widget.links = links[:widget.settings.numberOfPosts]
|
widget.links = links[:widget.settings.numberOfPosts]
|
||||||
widget.SetItemCount(len(widget.links))
|
widget.SetItemCount(len(widget.links))
|
||||||
widget.err = nil
|
widget.err = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
widget.Render()
|
widget.Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package twitch
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/nicklaw5/helix"
|
"github.com/nicklaw5/helix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package twitch
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/nicklaw5/helix"
|
"github.com/nicklaw5/helix"
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
|
@ -2,6 +2,7 @@ package arpansagovau
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
@ -2,11 +2,12 @@ package utils
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"golang.org/x/text/language"
|
|
||||||
"golang.org/x/text/message"
|
|
||||||
"math"
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"golang.org/x/text/language"
|
||||||
|
"golang.org/x/text/message"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user