Skip to content

Commit 9fe5f9a

Browse files
author
Andrea Spacca
authored
Golint (#404)
* golint * remove gitter badge
1 parent 788dfa2 commit 9fe5f9a

File tree

13 files changed

+251
-162
lines changed

13 files changed

+251
-162
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# transfer.sh [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dutchcoders/transfer.sh?utm_source=badge&utm_medium=badge&utm_campaign=&utm_campaign=pr-badge&utm_content=badge) [![Go Report Card](https://goreportcard.com/badge/github.com/dutchcoders/transfer.sh)](https://goreportcard.com/report/github.com/dutchcoders/transfer.sh) [![Docker pulls](https://img.shields.io/docker/pulls/dutchcoders/transfer.sh.svg)](https://hub.docker.com/r/dutchcoders/transfer.sh/) [![Build Status](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml?query=branch%3Amaster)
1+
# transfer.sh [![Go Report Card](https://goreportcard.com/badge/github.com/dutchcoders/transfer.sh)](https://goreportcard.com/report/github.com/dutchcoders/transfer.sh) [![Docker pulls](https://img.shields.io/docker/pulls/dutchcoders/transfer.sh.svg)](https://hub.docker.com/r/dutchcoders/transfer.sh/) [![Build Status](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml?query=branch%3Amaster)
22

33
Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance.
44

cmd/cmd.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"google.golang.org/api/googleapi"
1313
)
1414

15+
// Version is inject at build time
1516
var Version = "0.0.0"
1617
var helpTemplate = `NAME:
1718
{{.Name}} - {{.Usage}}
@@ -282,14 +283,16 @@ var globalFlags = []cli.Flag{
282283
},
283284
}
284285

286+
// Cmd wraps cli.app
285287
type Cmd struct {
286288
*cli.App
287289
}
288290

289-
func VersionAction(c *cli.Context) {
291+
func versionAction(c *cli.Context) {
290292
fmt.Println(color.YellowString(fmt.Sprintf("transfer.sh %s: Easy file sharing from the command line", Version)))
291293
}
292294

295+
// New is the factory for transfer.sh
293296
func New() *Cmd {
294297
logger := log.New(os.Stdout, "[transfer.sh]", log.LstdFlags)
295298

@@ -304,7 +307,7 @@ func New() *Cmd {
304307
app.Commands = []cli.Command{
305308
{
306309
Name: "version",
307-
Action: VersionAction,
310+
Action: versionAction,
308311
},
309312
}
310313

@@ -403,13 +406,13 @@ func New() *Cmd {
403406
}
404407

405408
if c.Bool("force-https") {
406-
options = append(options, server.ForceHTTPs())
409+
options = append(options, server.ForceHTTPS())
407410
}
408411

409412
if httpAuthUser := c.String("http-auth-user"); httpAuthUser == "" {
410413
} else if httpAuthPass := c.String("http-auth-pass"); httpAuthPass == "" {
411414
} else {
412-
options = append(options, server.HttpAuthCredentials(httpAuthUser, httpAuthPass))
415+
options = append(options, server.HTTPAuthCredentials(httpAuthUser, httpAuthPass))
413416
}
414417

415418
applyIPFilter := false
@@ -445,13 +448,13 @@ func New() *Cmd {
445448
case "gdrive":
446449
chunkSize := c.Int("gdrive-chunk-size")
447450

448-
if clientJsonFilepath := c.String("gdrive-client-json-filepath"); clientJsonFilepath == "" {
451+
if clientJSONFilepath := c.String("gdrive-client-json-filepath"); clientJSONFilepath == "" {
449452
panic("client-json-filepath not set.")
450453
} else if localConfigPath := c.String("gdrive-local-config-path"); localConfigPath == "" {
451454
panic("local-config-path not set.")
452455
} else if basedir := c.String("basedir"); basedir == "" {
453456
panic("basedir not set.")
454-
} else if storage, err := server.NewGDriveStorage(clientJsonFilepath, localConfigPath, basedir, chunkSize, logger); err != nil {
457+
} else if storage, err := server.NewGDriveStorage(clientJSONFilepath, localConfigPath, basedir, chunkSize, logger); err != nil {
455458
panic(err)
456459
} else {
457460
options = append(options, server.UseStorage(storage))

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
1212
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
1313
github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329
14-
github.com/dutchcoders/transfer.sh-web v0.0.0-20210723094506-f0946ebceb7a
14+
github.com/dutchcoders/transfer.sh-web v0.0.0-20210819203540-bbdd40be1311
1515
github.com/elazarl/go-bindata-assetfs v1.0.1
1616
github.com/fatih/color v1.10.0
1717
github.com/garyburd/redigo v1.6.2 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329 h1:ERqCk
8686
github.com/dutchcoders/go-virustotal v0.0.0-20140923143438-24cc8e6fa329/go.mod h1:G5qOfE5bQZ5scycLpB7fYWgN4y3xdfXo+pYWM8z2epY=
8787
github.com/dutchcoders/transfer.sh-web v0.0.0-20210723094506-f0946ebceb7a h1:+N7J1NK7gxKZ+X4syY1HqafUudJiR8voJGcXWkxLgAw=
8888
github.com/dutchcoders/transfer.sh-web v0.0.0-20210723094506-f0946ebceb7a/go.mod h1:F6Q37CxDh2MHr5KXkcZmNB3tdkK7v+bgE+OpBY+9ilI=
89+
github.com/dutchcoders/transfer.sh-web v0.0.0-20210819203540-bbdd40be1311 h1:/Rwuhcp8ZLUauWajAgMyy6AiVbobvD52I+/OnzThK0A=
90+
github.com/dutchcoders/transfer.sh-web v0.0.0-20210819203540-bbdd40be1311/go.mod h1:F6Q37CxDh2MHr5KXkcZmNB3tdkK7v+bgE+OpBY+9ilI=
8991
github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw=
9092
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
9193
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=

0 commit comments

Comments
 (0)