forked from electricdusk/rushlink
Fix gopls issues
This commit is contained in:
parent
6603ad886f
commit
30ab6f9228
@ -2,14 +2,12 @@ package db
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
gobmarsh "gitea.hashru.nl/dsprenkels/rushlink/pkg/gobmarsh"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"gorm.io/gorm"
|
||||
@ -84,7 +82,6 @@ func ErrHTTPStatusCode(err error) int {
|
||||
|
||||
// Base64 encoding and decoding
|
||||
var base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
var base64Encoder = base64.RawURLEncoding.WithPadding(base64.NoPadding)
|
||||
|
||||
func (t PasteType) String() string {
|
||||
switch t {
|
||||
@ -158,12 +155,6 @@ func GetPasteNoValidate(db *gorm.DB, key string) (*Paste, error) {
|
||||
return &ps[0], nil
|
||||
}
|
||||
|
||||
func decodePaste(storedBytes []byte) (*Paste, error) {
|
||||
p := &Paste{}
|
||||
err := gobmarsh.Unmarshal(storedBytes, p)
|
||||
return p, err
|
||||
}
|
||||
|
||||
// Save saves this Paste to the database.
|
||||
func (p *Paste) Save(db *gorm.DB) error {
|
||||
return db.Save(p).Error
|
||||
|
Loading…
Reference in New Issue
Block a user