Running gofmt on project.

This commit is contained in:
Nick Gerakines 2020-03-26 11:11:45 -04:00
parent 2b8a40f820
commit afddcc7d31
No known key found for this signature in database
GPG Key ID: 33D43D854F96B2E4
12 changed files with 7778 additions and 7786 deletions

View File

@ -48,16 +48,16 @@ func InstrumentedDefaultHTTPClient(metricFactory promauto.Factory, namespace, su
inFlightGauge := metricFactory.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "in_flight_requests",
Help: "A gauge of in-flight requests for the wrapped client.",
Name: "in_flight_requests",
Help: "A gauge of in-flight requests for the wrapped client.",
})
counter := metricFactory.NewCounterVec(
prometheus.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "requests_total",
Help: "A counter for requests from the wrapped client.",
Name: "requests_total",
Help: "A counter for requests from the wrapped client.",
},
[]string{"code", "method"},
)
@ -66,9 +66,9 @@ func InstrumentedDefaultHTTPClient(metricFactory promauto.Factory, namespace, su
prometheus.HistogramOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "dns_duration_seconds",
Help: "Trace dns latency histogram.",
Buckets: []float64{.005, .01, .025, .05},
Name: "dns_duration_seconds",
Help: "Trace dns latency histogram.",
Buckets: []float64{.005, .01, .025, .05},
},
[]string{"event"},
)
@ -77,9 +77,9 @@ func InstrumentedDefaultHTTPClient(metricFactory promauto.Factory, namespace, su
prometheus.HistogramOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "tls_duration_seconds",
Help: "Trace tls latency histogram.",
Buckets: []float64{.05, .1, .25, .5},
Name: "tls_duration_seconds",
Help: "Trace tls latency histogram.",
Buckets: []float64{.05, .1, .25, .5},
},
[]string{"event"},
)
@ -88,9 +88,9 @@ func InstrumentedDefaultHTTPClient(metricFactory promauto.Factory, namespace, su
prometheus.HistogramOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "request_duration_seconds",
Help: "A histogram of request latencies.",
Buckets: prometheus.DefBuckets,
Name: "request_duration_seconds",
Help: "A histogram of request latencies.",
Buckets: prometheus.DefBuckets,
},
[]string{"method"},
)

View File

@ -1,2 +1 @@
package common

View File

@ -4,8 +4,8 @@ import (
"github.com/urfave/cli/v2"
)
var EnvironmentFlag = cli.StringFlag{Name: "environment", Usage: "Set the environment the application is running in.", EnvVars: []string{"ENVIRONMENT",}, Value: "development",}
var EnvironmentFlag = cli.StringFlag{Name: "environment", Usage: "Set the environment the application is running in.", EnvVars: []string{"ENVIRONMENT"}, Value: "development"}
var ListenFlag = cli.StringFlag{Name: "listen", Usage: "Configure the server to listen to this interface.", EnvVars: []string{"LISTEN",}, Value: "0.0.0.0:8000",}
var ListenFlag = cli.StringFlag{Name: "listen", Usage: "Configure the server to listen to this interface.", EnvVars: []string{"LISTEN"}, Value: "0.0.0.0:8000"}
var DomainFlag = cli.StringFlag{Name: "domain", Usage: "Set the website domain.", Value: "tavern.ngrok.io", EnvVars: []string{"DOMAIN",},}
var DomainFlag = cli.StringFlag{Name: "domain", Usage: "Set the website domain.", Value: "tavern.ngrok.io", EnvVars: []string{"DOMAIN"}}

View File

@ -21,7 +21,7 @@ var EnableSentryFlag = cli.BoolFlag{
var SentryFlag = cli.StringFlag{
Name: "sentry",
Usage: "Configure the sentry key to use.",
EnvVars: []string{"SENTRY_KEY",},
EnvVars: []string{"SENTRY_KEY"},
Value: "",
}

View File

@ -11,14 +11,14 @@ var DatabaseFlag = cli.StringFlag{
Name: "database",
Usage: "Select the database to connect to.",
Value: "host=localhost port=5432 user=postgres dbname=tavern password=password sslmode=disable",
EnvVars: []string{"DATABASE",},
EnvVars: []string{"DATABASE"},
}
var MigrationsPathFlag = cli.StringFlag{
Name: "migrations",
Usage: "The path to database migrations",
Value: "file://migrations/",
EnvVars: []string{"DATABASE_MIGRATIONS",},
EnvVars: []string{"DATABASE_MIGRATIONS"},
}
func DB(c *cli.Context, logger *zap.Logger) (*sql.DB, func(), error) {

View File

@ -14,7 +14,7 @@ var EnableSVGerFlag = cli.BoolFlag{
var SVGerEndpointFlag = cli.StringFlag{
Name: "svger",
Usage: "The SVGer to interact with.",
EnvVars: []string{"SVGER",},
EnvVars: []string{"SVGER"},
Value: "http://localhost:5003/",
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,4 +11,4 @@ var (
Unwrap = errors.Unwrap
)
type ErrorWrapper func(error) error
type ErrorWrapper func(error) error

View File

@ -360,7 +360,7 @@ func (h handler) actorInboxCreate(c *gin.Context, user *storage.User, payload st
if err != nil {
return err
}
if hasInReplyTo {
if hasInReplyTo {
replyRowID, err := storage.ObjectRowIDForObjectID(ctx, inReplyTo)
if err == nil {
_, err = storage.RecordObjectReply(ctx, activityObjectRowID, replyRowID)

View File

@ -36,4 +36,4 @@ func (h handler) tavernTerms(c *gin.Context) {
func (h handler) tavernUsage(c *gin.Context) {
c.HTML(http.StatusOK, "tavern_usage", gin.H{})
}
}

View File

@ -34,7 +34,6 @@ func (h handler) utilitiesWebfinger(c *gin.Context) {
h.flashSuccessOrFail(c, h.url("utilities"), "actor queued")
}
func (h handler) utilitiesCrawl(c *gin.Context) {
_, _, _, cont := h.loggedIn(c, true)
if !cont {