From 85536ff79e1519c0bfc621b5dc4bc2e67af64bac Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 24 May 2021 15:58:43 +0100 Subject: [PATCH] expand CONTRIBUTING, print if tray enabled on startup --- .goreleaser.yml | 1 - CONTRIBUTING.md | 5 +++++ go.mod | 4 ++-- go.sum | 4 ++++ main.go | 6 +++++- updater.go | 1 - 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8c7a244..3c57ec4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -153,4 +153,3 @@ nfpms: apk: dependencies: - libappindicator - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcc89fe..9525c60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,11 @@ #### Code I use 4 spaces for indentation. Go should ideally be formatted with `goimports` and/or `gofmt`. I don't use a formatter on typescript, so don't worry about that. +Code in Go should ideally use `PascalCase` for exported values, and `camelCase` for non-exported, JSON for transferring data should use `snake_case`, and Typescript should use `camelCase`. Forgive me for my many inconsistencies in this, and feel free to fix them if you want. + +Functions in Go that need to access `*appContext` should be generally be receivers, except when the behaviour could be seen as somewhat independent from it (`email.go` is the best example, its behaviour is broadly independent from the main app except from a couple config values). + + #### Compiling Prefix each of these with `make DEBUG=on INTERNAL=off `: diff --git a/go.mod b/go.mod index 1ca27fc..0545110 100644 --- a/go.mod +++ b/go.mod @@ -47,8 +47,8 @@ require ( github.com/ugorji/go v1.2.0 // indirect github.com/writeas/go-strip-markdown v2.0.1+incompatible golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 // indirect - golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect - golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect + golang.org/x/net v0.0.0-20210521195947-fe42d452be8f // indirect + golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1 // indirect golang.org/x/tools v0.1.1 // indirect google.golang.org/protobuf v1.25.0 // indirect gopkg.in/ini.v1 v1.62.0 diff --git a/go.sum b/go.sum index 8c9ae47..bea5172 100644 --- a/go.sum +++ b/go.sum @@ -306,6 +306,8 @@ golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210521195947-fe42d452be8f h1:Si4U+UcgJzya9kpiEUJKQvjr512OLli+gL4poHrz93U= +golang.org/x/net v0.0.0-20210521195947-fe42d452be8f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -338,6 +340,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1 h1:lCnv+lfrU9FRPGf8NeRuWAAPjNnema5WtBinMgs1fD8= +golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/main.go b/main.go index 1963aee..f8b7450 100644 --- a/main.go +++ b/main.go @@ -708,7 +708,11 @@ func flagPassed(name string) (found bool) { // @tag.description Things that dont fit elsewhere. func printVersion() { - fmt.Println(info("jfa-go version: %s (%s)\n", hiwhite(version), white(commit))) + tray := "" + if TRAY { + tray = " TrayIcon" + } + fmt.Println(info("jfa-go version: %s (%s)%s\n", hiwhite(version), white(commit), tray)) } func main() { diff --git a/updater.go b/updater.go index c3b45a8..a12c7a2 100644 --- a/updater.go +++ b/updater.go @@ -184,7 +184,6 @@ func (ud *Updater) GetTag() (Tag, int, error) { return Tag{}, -1, nil } url := fmt.Sprintf("%s/repo/%s/%s/tag/latest/%s", ud.url, ud.namespace, ud.name, ud.tag) - fmt.Println(url) req, _ := http.NewRequest("GET", url, nil) resp, err := ud.httpClient.Do(req) defer ud.timeoutHandler()