Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Irvingouj committed Dec 3, 2023
1 parent ec5bfb5 commit 0931a98
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions store/db/postgres/memo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, e
Columns("creator_id", "content", "visibility")

// Add initial values for the columns
values := []interface{}{create.CreatorID, create.Content, create.Visibility}
values := []any{create.CreatorID, create.Content, create.Visibility}

// Conditionally add other fields and values
if create.ID != 0 {
Expand Down Expand Up @@ -120,7 +120,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo

if v := find.VisibilityList; len(v) != 0 {
placeholders := make([]string, len(v))
args := make([]interface{}, len(v))
args := make([]any, len(v))
for i, visibility := range v {
placeholders[i] = "?"
args[i] = visibility // Assuming visibility can be directly used as an argument
Expand Down
4 changes: 2 additions & 2 deletions store/db/postgres/memo_relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ func vacuumMemoRelations(ctx context.Context, tx *sql.Tx) error {
}

// Combine the arguments for both instances of the same subquery
combinedArgs := append(args, subArgsMemo...)
args = append(args, subArgsMemo...)

// Execute the query
_, err = tx.ExecContext(ctx, query, combinedArgs...)
_, err = tx.ExecContext(ctx, query, args...)
return err
}
4 changes: 2 additions & 2 deletions store/db/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"database/sql"
"log"

// Import the PostgreSQL driver
// Import the PostgreSQL driver.
_ "github.com/lib/pq"
"github.com/pkg/errors"

Expand Down Expand Up @@ -78,7 +78,7 @@ func (*DB) BackupTo(context.Context, string) error {
return errors.New("Please use postgresdump to backup")
}

func (d *DB) GetCurrentDBSize(context.Context) (int64, error) {
func (_ *DB) GetCurrentDBSize(context.Context) (int64, error) {

Check warning on line 81 in store/db/postgres/postgres.go

View workflow job for this annotation

GitHub Actions / go-static-checks

receiver-naming: receiver name should not be an underscore, omit the name if it is unused (revive)
return 0, errors.New("unimplemented")
}

Expand Down
2 changes: 1 addition & 1 deletion store/db/postgres/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func (d *DB) CreateResource(ctx context.Context, create *store.Resource) (*store.Resource, error) {
qb := squirrel.Insert("resource").Columns("filename", "blob", "external_link", "type", "size", "creator_id", "internal_path")
values := []interface{}{create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath}
values := []any{create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath}

if create.ID != 0 {
qb = qb.Columns("id")
Expand Down

0 comments on commit 0931a98

Please sign in to comment.