Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/wtf_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (wtfApp *WtfApp) watchForConfigChanges() {

config := cfg.LoadWtfConfigFile(wtfApp.configFilePath)
newApp := NewWtfApp(wtfApp.TViewApp, config, wtfApp.configFilePath)
openURLUtil := utils.ToStrs(config.UList("wtf.openUrlUtil", []interface{}{}))
openURLUtil := utils.ToStrs(config.UList("wtf.openUrlUtil", []any{}))
utils.Init(config.UString("wtf.openFileUtil", "open"), openURLUtil)

newApp.Start()
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
}

openFileUtil := config.UString("wtf.openFileUtil", "open")
openURLUtil := utils.ToStrs(config.UList("wtf.openUrlUtil", []interface{}{}))
openURLUtil := utils.ToStrs(config.UList("wtf.openUrlUtil", []any{}))
utils.Init(openFileUtil, openURLUtil)

/* Initialize the App Manager */
Expand Down
2 changes: 1 addition & 1 deletion modules/asana/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (widget *Widget) Render() {

func (widget *Widget) Fetch(workspaceId, projectId, mode string, sections []string, allUsers bool) ([]*TaskItem, error) {

availableModes := map[string]interface{}{
availableModes := map[string]any{
"project": nil,
"project_sections": nil,
"workspace": nil,
Expand Down
2 changes: 1 addition & 1 deletion modules/clocks/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func buildLocations(ymlConfig *config.Config) []Clock {

listLocations := ymlConfig.UList("locations")
for _, location := range listLocations {
if location, ok := location.(map[string]interface{}); ok {
if location, ok := location.(map[string]any); ok {
for k, v := range location {
name := k
zone := v.(string)
Expand Down
2 changes: 1 addition & 1 deletion modules/covid/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ type Latest struct {
Confirmed int `json:"confirmed"`
Deaths int `json:"deaths"`
// Not currently used but holds information about the country
Locations []interface{} `json:"locations,omitempty"`
Locations []any `json:"locations,omitempty"`
}
2 changes: 1 addition & 1 deletion modules/covid/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func LatestCases() (*Cases, error) {
}

// LatestCountryCases queries the /locations endpoint, takes a query parameter: the country code
func (widget *Widget) LatestCountryCases(countries []interface{}) ([]*Cases, error) {
func (widget *Widget) LatestCountryCases(countries []any) ([]*Cases, error) {
countriesCovidData := []*Cases{}
for _, name := range countries {
countryURL := covidTrackerAPIURL + "locations?source=jhu&country_code=" + name.(string)
Expand Down
2 changes: 1 addition & 1 deletion modules/covid/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
type Settings struct {
*cfg.Common

countries []interface{} `help:"Countries (codes) from which to retrieve stats."`
countries []any `help:"Countries (codes) from which to retrieve stats."`
}

// NewSettingsFromYAML returns the settings from the config yaml file
Expand Down
6 changes: 3 additions & 3 deletions modules/cryptoexchanges/bittrex/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type colors struct {

type currency struct {
displayName string
market []interface{}
market []any
}

type summary struct {
Expand Down Expand Up @@ -53,11 +53,11 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co

settings.summary.currencies = make(map[string]*currency)
for key, val := range ymlConfig.UMap("summary") {
coercedVal := val.(map[string]interface{})
coercedVal := val.(map[string]any)

currency := &currency{
displayName: coercedVal["displayName"].(string),
market: coercedVal["market"].([]interface{}),
market: coercedVal["market"].([]any),
}

settings.summary.currencies[key] = currency
Expand Down
2 changes: 1 addition & 1 deletion modules/cryptoexchanges/bittrex/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (widget *Widget) setSummaryList() {
}
}

func (widget *Widget) makeSummaryMarketList(market []interface{}) []*mCurrency {
func (widget *Widget) makeSummaryMarketList(market []any) []*mCurrency {
mCurrencyList := []*mCurrency{}

for _, marketSymbol := range market {
Expand Down
6 changes: 3 additions & 3 deletions modules/cryptoexchanges/cryptolive/price/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type colors struct {

type currency struct {
displayName string
to []interface{}
to []any
}

type Settings struct {
Expand Down Expand Up @@ -66,11 +66,11 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
settings.currencies = make(map[string]*currency)

for key, val := range ymlConfig.UMap("currencies") {
coercedVal := val.(map[string]interface{})
coercedVal := val.(map[string]any)

currency := &currency{
displayName: coercedVal["displayName"].(string),
to: coercedVal["to"].([]interface{}),
to: coercedVal["to"].([]any),
}

settings.currencies[key] = currency
Expand Down
4 changes: 2 additions & 2 deletions modules/cryptoexchanges/cryptolive/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type Settings struct {

colors

currencies map[string]interface{}
top map[string]interface{}
currencies map[string]any
top map[string]any

priceSettings *price.Settings
toplistSettings *toplist.Settings
Expand Down
6 changes: 3 additions & 3 deletions modules/cryptoexchanges/cryptolive/toplist/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type colors struct {
type currency struct {
displayName string
limit int
to []interface{}
to []any
}

type Settings struct {
Expand Down Expand Up @@ -67,14 +67,14 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
settings.top = make(map[string]*currency)

for key, val := range ymlConfig.UMap("top") {
coercedVal := val.(map[string]interface{})
coercedVal := val.(map[string]any)

limit, _ := coercedVal["limit"].(int)

currency := &currency{
displayName: coercedVal["displayName"].(string),
limit: limit,
to: coercedVal["to"].([]interface{}),
to: coercedVal["to"].([]any),
}

settings.top[key] = currency
Expand Down
6 changes: 3 additions & 3 deletions modules/datadog/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const (
type Settings struct {
*cfg.Common

apiKey string `help:"Your Datadog API key."`
applicationKey string `help:"Your Datadog Application key."`
tags []interface{} `help:"Array of tags you want to query monitors by."`
apiKey string `help:"Your Datadog API key."`
applicationKey string `help:"Your Datadog Application key."`
tags []any `help:"Array of tags you want to query monitors by."`
}

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
Expand Down
2 changes: 1 addition & 1 deletion modules/digitalocean/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (widget *Widget) content() (string, string, bool) {
fmtStr += "%-12s"
}

vals := []interface{}{
vals := []any{
widget.RowColor(idx),
}

Expand Down
2 changes: 1 addition & 1 deletion modules/digitalocean/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (

// defaultColumns defines the default set of columns to display in the widget
// This can be over-ridden in the cofig by explicitly defining a set of columns
var defaultColumns = []interface{}{
var defaultColumns = []any{
"Name",
"Status",
"Region.Slug",
Expand Down
2 changes: 1 addition & 1 deletion modules/docker/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
)

func padSlice(padLeft bool, slice interface{}, getter func(i int) string, setter func(i int, newVal string)) {
func padSlice(padLeft bool, slice any, getter func(i int) string, setter func(i int, newVal string)) {
rv := reflect.ValueOf(slice)
length := rv.Len()
maxLen := 0
Expand Down
2 changes: 1 addition & 1 deletion modules/feedreader/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
credentials := make(map[string]auth)
feeds := make([]string, 0)
for url, creds := range ymlConfig.UMap("feeds") {
parsed, ok := creds.(map[string]interface{})
parsed, ok := creds.(map[string]any)
if !ok {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion modules/gcal/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (widget *Widget) titleColor(calEvent *CalEvent) string {
color := widget.settings.colors.title

for _, untypedArr := range widget.settings.colors.highlights {
highlightElements := utils.ToStrs(untypedArr.([]interface{}))
highlightElements := utils.ToStrs(untypedArr.([]any))

match, _ := regexp.MatchString(
strings.ToLower(highlightElements[0]),
Expand Down
2 changes: 1 addition & 1 deletion modules/gcal/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type colors struct {
past string `help:"The color for calendar events that have passed." values:"Any X11 color name." optional:"true"`
title string `help:"The default colour for calendar event titles." values:"Any X11 color name." optional:"true"`

highlights []interface{} `help:"A list of arrays that define a regular expression pattern and a color. If a calendar event title matches a regular expression, the title will be drawn in that colour. Over-rides the default title colour." values:"An array of a valid regular expression, any X11 color name." optional:"true"`
highlights []any `help:"A list of arrays that define a regular expression pattern and a color. If a calendar event title matches a regular expression, the title will be drawn in that colour. Over-rides the default title colour." values:"An array of a valid regular expression, any X11 color name." optional:"true"`
}

// Settings defines the configuration options for this module
Expand Down
10 changes: 5 additions & 5 deletions modules/gerrit/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ type Settings struct {
colors
*cfg.Common

domain string `help:"Your Gerrit corporate domain."`
password string `help:"Your Gerrit HTTP Password."`
projects []interface{} `help:"A list of Gerrit project names to fetch data for."`
username string `help:"Your Gerrit username."`
verifyServerCertificate bool `help:"Determines whether or not the server’s certificate chain and host name are verified." values:"true or false" optional:"true"`
domain string `help:"Your Gerrit corporate domain."`
password string `help:"Your Gerrit HTTP Password."`
projects []any `help:"A list of Gerrit project names to fetch data for."`
username string `help:"Your Gerrit username."`
verifyServerCertificate bool `help:"Determines whether or not the server’s certificate chain and host name are verified." values:"true or false" optional:"true"`
}

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
Expand Down
2 changes: 1 addition & 1 deletion modules/gerrit/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (widget *Widget) unselect() {
widget.display()
}

func (widget *Widget) buildProjectCollection(projectData []interface{}) []*GerritProject {
func (widget *Widget) buildProjectCollection(projectData []any) []*GerritProject {
gerritProjects := []*GerritProject{}

for _, name := range projectData {
Expand Down
18 changes: 9 additions & 9 deletions modules/git/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const (
type Settings struct {
*cfg.Common

commitCount int `help:"The number of past commits to display." values:"A positive integer, 0..n." optional:"true"`
sections []interface{} `help:"Sections to show" optional:"true"`
showModuleName bool `help:"Whether to show 'Git - ' before information in title" optional:"true" default:"true"`
branchInTitle bool `help:"Whether to show branch name in title instead of the widget body itself" optional:"true" default:"false"`
showFilesIfEmpty bool `help:"Whether to show Changed Files section if no changed files" optional:"true" default:"true"`
lastFolderTitle bool `help:"Whether to show only last part of directory path instead of full path" optional:"true" default:"false"`
commitFormat string `help:"The string format for the commit message." optional:"true"`
dateFormat string `help:"The string format for the date/time in the commit message." optional:"true"`
repositories []interface{} `help:"Defines which git repositories to watch." values:"A list of zero or more local file paths pointing to valid git repositories."`
commitCount int `help:"The number of past commits to display." values:"A positive integer, 0..n." optional:"true"`
sections []any `help:"Sections to show" optional:"true"`
showModuleName bool `help:"Whether to show 'Git - ' before information in title" optional:"true" default:"true"`
branchInTitle bool `help:"Whether to show branch name in title instead of the widget body itself" optional:"true" default:"false"`
showFilesIfEmpty bool `help:"Whether to show Changed Files section if no changed files" optional:"true" default:"true"`
lastFolderTitle bool `help:"Whether to show only last part of directory path instead of full path" optional:"true" default:"false"`
commitFormat string `help:"The string format for the commit message." optional:"true"`
dateFormat string `help:"The string format for the date/time in the commit message." optional:"true"`
repositories []any `help:"Defines which git repositories to watch." values:"A list of zero or more local file paths pointing to valid git repositories."`
}

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
Expand Down
2 changes: 1 addition & 1 deletion modules/github/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func parseCustomQueries(ymlConfig *config.Config) []customQuery {
if customQueries, err := ymlConfig.Map("customQueries"); err == nil {
for _, query := range customQueries {
c := customQuery{}
for key, value := range query.(map[string]interface{}) {
for key, value := range query.(map[string]any) {
switch key {
case "title":
c.title = value.(string)
Expand Down
2 changes: 1 addition & 1 deletion modules/gitlab/gitlab_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (project *GitlabProject) loadAssignedIssues() ([]*glb.Issue, error) {
return issues, nil
}

func (project *GitlabProject) loadAuthoredIssues() ([]*glb.Issue, interface{}) {
func (project *GitlabProject) loadAuthoredIssues() ([]*glb.Issue, any) {
state := "opened"
opts := glb.ListProjectIssuesOptions{
State: &state,
Expand Down
2 changes: 1 addition & 1 deletion modules/googleanalytics/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func makeReportServiceV4(secretPath string) (*gaV4.Service, error) {
}

func getReports(
serviceV4 *gaV4.Service, viewIds map[string]interface{}, displayedMonths int, serviceV3 *gaV3.Service,
serviceV4 *gaV4.Service, viewIds map[string]any, displayedMonths int, serviceV3 *gaV3.Service,
) []websiteReport {
startDate := fmt.Sprintf("%s-01", time.Now().AddDate(0, -displayedMonths+1, 0).Format("2006-01"))
var websiteReports []websiteReport
Expand Down
2 changes: 1 addition & 1 deletion modules/googleanalytics/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Settings struct {

months int
secretFile string `help:"Your Google client secret JSON file." values:"A string representing a file path to the JSON secret file."`
viewIds map[string]interface{}
viewIds map[string]any
enableRealtime bool
}

Expand Down
4 changes: 2 additions & 2 deletions modules/gspreadsheets/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type Settings struct {
colors
*cfg.Common

cellAddresses []interface{}
cellNames []interface{}
cellAddresses []any
cellNames []any
secretFile string
sheetID string
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ipaddresses/ipapi/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type colors struct {
type Settings struct {
colors
*cfg.Common
args []interface{} `help:"Defines what data to display and the order." values:"'ip', 'isp', 'as', 'asName', 'district', 'city', 'region', 'regionName', 'country', 'countryCode', 'continent', 'continentCode', 'coordinates', 'postalCode', 'currency', 'organization', 'timezone' and/or 'reverseDNS'"`
args []any `help:"Defines what data to display and the order." values:"'ip', 'isp', 'as', 'asName', 'district', 'city', 'region', 'regionName', 'country', 'countryCode', 'continent', 'continentCode', 'coordinates', 'postalCode', 'currency', 'organization', 'timezone' and/or 'reverseDNS'"`
}

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
Expand Down
26 changes: 13 additions & 13 deletions modules/krisinformation/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ type Krisinformation []struct {
Preamble string `json:"Preamble"`
BodyText string `json:"BodyText"`
Area []struct {
Type string `json:"Type"`
Description string `json:"Description"`
Coordinate string `json:"Coordinate"`
GeometryInformation interface{} `json:"GeometryInformation"`
Type string `json:"Type"`
Description string `json:"Description"`
Coordinate string `json:"Coordinate"`
GeometryInformation any `json:"GeometryInformation"`
} `json:"Area"`
Web string `json:"Web"`
Language string `json:"Language"`
Event string `json:"Event"`
SenderName string `json:"SenderName"`
Push bool `json:"Push"`
BodyLinks []interface{} `json:"BodyLinks"`
SourceID int `json:"SourceID"`
IsVma bool `json:"IsVma"`
IsTestVma bool `json:"IsTestVma"`
Web string `json:"Web"`
Language string `json:"Language"`
Event string `json:"Event"`
SenderName string `json:"SenderName"`
Push bool `json:"Push"`
BodyLinks []any `json:"BodyLinks"`
SourceID int `json:"SourceID"`
IsVma bool `json:"IsVma"`
IsTestVma bool `json:"IsTestVma"`
}

// Client holds or configuration
Expand Down
6 changes: 3 additions & 3 deletions modules/mercurial/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const (
type Settings struct {
*cfg.Common

commitCount int `help:"The number of past commits to display." optional:"true"`
commitFormat string `help:"The string format for the commit message." optional:"true"`
repositories []interface{} `help:"Defines which mercurial repositories to watch." values:"A list of zero or more local file paths pointing to valid mercurial repositories."`
commitCount int `help:"The number of past commits to display." optional:"true"`
commitFormat string `help:"The string format for the commit message." optional:"true"`
repositories []any `help:"Defines which mercurial repositories to watch." values:"A list of zero or more local file paths pointing to valid mercurial repositories."`
}

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
Expand Down
Loading