Skip to content

Commit

Permalink
refactor: Changed wsl linter to gofumpt formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kyee-rs committed Jul 23, 2023
1 parent bd6c08a commit 17c0fd7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ linters:
- bidichk
- dupl
- revive
- wsl
- gocognit
- gofumpt

linters-settings:
revive:
Expand Down
2 changes: 1 addition & 1 deletion internal/clients.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"helium/ent"
"net/http"

framework "github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"helium/ent"
)

func createConnector(context framework.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"database/sql"
"helium/ent"
"net/http"

"entgo.io/ent/dialect"
entsql "entgo.io/ent/dialect/sql"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"helium/ent"
)

func StatusReport(ctx echo.Context, c int) error {
Expand Down
4 changes: 2 additions & 2 deletions internal/parser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"helium/ent"
"helium/ent/user"
"net/http"
"regexp"
"strings"
Expand All @@ -10,8 +12,6 @@ import (

"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"helium/ent"
"helium/ent/user"
)

var rg = regexp.MustCompile(`(\r\n?|\n){2,}`)
Expand Down
9 changes: 4 additions & 5 deletions internal/routes.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package main

import (
"helium/ent"
"helium/ent/connector"
"helium/ent/receiver"
"helium/ent/user"
"net/http"

"github.com/google/uuid"
framework "github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"helium/ent"
"helium/ent/connector"
"helium/ent/receiver"
"helium/ent/user"
)

func connectAccount(c framework.Context) error {
Expand All @@ -23,7 +23,6 @@ func connectAccount(c framework.Context) error {

connectorID := c.Get("connectorID").(string)
parsedUUID, err := uuid.Parse(uniqueID)

if err != nil {
return StatusReport(c, http.StatusBadRequest)
}
Expand Down
11 changes: 4 additions & 7 deletions internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package main

import (
"context"
"helium/ent"
"helium/ent/connector"
"helium/ent/letter"
"helium/ent/user"
"net/http"
"os"
"os/signal"
Expand All @@ -14,10 +18,6 @@ import (
framework "github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
log "github.com/sirupsen/logrus"
"helium/ent"
"helium/ent/connector"
"helium/ent/letter"
"helium/ent/user"
)

var (
Expand All @@ -37,7 +37,6 @@ func timesReceivedNullification() {
}).Infoln("Running a TimesReceived nullification cronjob")

_, err := db.User.Update().Where(user.Paid(false)).SetCounter(0).Save(ctx)

if err != nil {
log.WithFields(log.Fields{
"function": "timesReceivedNullification",
Expand All @@ -52,7 +51,6 @@ func letterNullification() {
}).Infoln("Running a letter nullification cronjob")

_, err := db.Letter.Delete().Where(letter.CreatedAtLT(time.Now().AddDate(0, 0, -3))).Exec(ctx)

if err != nil {
log.WithFields(log.Fields{
"function": "letterNullification",
Expand Down Expand Up @@ -126,7 +124,6 @@ func init() {

var seed uint64 = 48292
genSid, err := shortid.New(1, shortid.DefaultABC, seed)

if err != nil {
log.WithFields(log.Fields{
"function": "init(shortid.New)",
Expand Down
4 changes: 2 additions & 2 deletions internal/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"bytes"
"helium/ent"
"helium/ent/letter"
"io"
"mime/multipart"
"net/http"

framework "github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"helium/ent"
"helium/ent/letter"
)

func uploadFiles(c framework.Context) []string {
Expand Down

0 comments on commit 17c0fd7

Please sign in to comment.