autofix: fix unused method receiver (#6808)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
deepsource-autofix[bot] 2022-03-06 16:37:41 +08:00 committed by GitHub
parent b7372b1f32
commit 09dbbf9a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 23 deletions

View File

@ -33,20 +33,20 @@ func (d fileInfo) Size() int64 {
return d.size return d.size
} }
func (d fileInfo) Mode() os.FileMode { func (fileInfo) Mode() os.FileMode {
return os.FileMode(0644) | os.ModeDir return os.FileMode(0644) | os.ModeDir
} }
func (d fileInfo) ModTime() time.Time { func (fileInfo) ModTime() time.Time {
return time.Time{} return time.Time{}
} }
// IsDir return file whether a directory // IsDir return file whether a directory
func (d *fileInfo) IsDir() bool { func (*fileInfo) IsDir() bool {
return true return true
} }
func (d fileInfo) Sys() interface{} { func (fileInfo) Sys() interface{} {
return nil return nil
} }
@ -59,7 +59,7 @@ type file struct {
childrenOffset int childrenOffset int
} }
func (f *file) Close() error { func (*file) Close() error {
return nil return nil
} }
@ -95,7 +95,7 @@ func (f *file) Stat() (os.FileInfo, error) {
// fileSystem implements the http.FileSystem interface. // fileSystem implements the http.FileSystem interface.
type fileSystem struct{} type fileSystem struct{}
func (f *fileSystem) Open(name string) (http.File, error) { func (*fileSystem) Open(name string) (http.File, error) {
if len(name) > 0 && name[0] == '/' { if len(name) > 0 && name[0] == '/' {
name = name[1:] name = name[1:]
} }

View File

@ -44,11 +44,11 @@ func (p *Provider) Config() interface{} {
return p.config return p.config
} }
func (p *Provider) HasTLS() bool { func (*Provider) HasTLS() bool {
return true return true
} }
func (p *Provider) UseTLS() bool { func (*Provider) UseTLS() bool {
return true return true
} }

View File

@ -86,7 +86,7 @@ func (c *Config) sanitizedUserDN(username string) (string, bool) {
return strings.ReplaceAll(c.UserDN, "%s", username), true return strings.ReplaceAll(c.UserDN, "%s", username), true
} }
func (c *Config) sanitizedGroupFilter(group string) (string, bool) { func (*Config) sanitizedGroupFilter(group string) (string, bool) {
// See http://tools.ietf.org/search/rfc4515 // See http://tools.ietf.org/search/rfc4515
badCharacters := "\x00*\\" badCharacters := "\x00*\\"
if strings.ContainsAny(group, badCharacters) { if strings.ContainsAny(group, badCharacters) {
@ -97,7 +97,7 @@ func (c *Config) sanitizedGroupFilter(group string) (string, bool) {
return group, true return group, true
} }
func (c *Config) sanitizedGroupDN(groupDn string) (string, bool) { func (*Config) sanitizedGroupDN(groupDn string) (string, bool) {
// See http://tools.ietf.org/search/rfc4514: "special characters" // See http://tools.ietf.org/search/rfc4514: "special characters"
badCharacters := "\x00()*\\'\"#+;<>" badCharacters := "\x00()*\\'\"#+;<>"
if strings.ContainsAny(groupDn, badCharacters) || strings.HasPrefix(groupDn, " ") || strings.HasSuffix(groupDn, " ") { if strings.ContainsAny(groupDn, badCharacters) || strings.HasPrefix(groupDn, " ") || strings.HasSuffix(groupDn, " ") {

View File

@ -11,6 +11,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
func (c *Config) doAuth(_, _ string) error { func (*Config) doAuth(_, _ string) error {
return errors.New("PAM not supported") return errors.New("PAM not supported")
} }

View File

@ -41,14 +41,14 @@ func (p *Provider) Config() interface{} {
return p.config return p.config
} }
func (p *Provider) HasTLS() bool { func (*Provider) HasTLS() bool {
return false return false
} }
func (p *Provider) UseTLS() bool { func (*Provider) UseTLS() bool {
return false return false
} }
func (p *Provider) SkipTLSVerify() bool { func (*Provider) SkipTLSVerify() bool {
return false return false
} }

View File

@ -92,7 +92,7 @@ func (p *Provider) Config() interface{} {
return p.config return p.config
} }
func (p *Provider) HasTLS() bool { func (*Provider) HasTLS() bool {
return true return true
} }

View File

@ -77,7 +77,7 @@ func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password} return &loginAuth{username, password}
} }
func (a *loginAuth) Start(_ *smtp.ServerInfo) (string, []byte, error) { func (*loginAuth) Start(_ *smtp.ServerInfo) (string, []byte, error) {
return "LOGIN", []byte{}, nil return "LOGIN", []byte{}, nil
} }
@ -97,7 +97,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
type Sender struct{} type Sender struct{}
func (s *Sender) Send(from string, to []string, msg io.WriterTo) error { func (*Sender) Send(from string, to []string, msg io.WriterTo) error {
opts := conf.Email opts := conf.Email
host, port, err := net.SplitHostPort(opts.Host) host, port, err := net.SplitHostPort(opts.Host)

View File

@ -45,7 +45,7 @@ type LocalStorage struct {
Root string Root string
} }
func (s *LocalStorage) Storage() Storage { func (*LocalStorage) Storage() Storage {
return StorageLocal return StorageLocal
} }

View File

@ -121,7 +121,7 @@ func (h *basicHandler) serveUpload(c *macaron.Context, repo *db.Repository, oid
} }
// POST /{owner}/{repo}.git/info/lfs/object/basic/verify // POST /{owner}/{repo}.git/info/lfs/object/basic/verify
func (h *basicHandler) serveVerify(c *macaron.Context, repo *db.Repository) { func (*basicHandler) serveVerify(c *macaron.Context, repo *db.Repository) {
var request basicVerifyRequest var request basicVerifyRequest
defer c.Req.Request.Body.Close() defer c.Req.Request.Body.Close()
err := json.NewDecoder(c.Req.Request.Body).Decode(&request) err := json.NewDecoder(c.Req.Request.Body).Decode(&request)

View File

@ -27,7 +27,7 @@ type mockStorage struct {
buf *bytes.Buffer buf *bytes.Buffer
} }
func (s *mockStorage) Storage() lfsutil.Storage { func (*mockStorage) Storage() lfsutil.Storage {
return "memory" return "memory"
} }

View File

@ -13,15 +13,15 @@ var _ log.Logger = (*noopLogger)(nil)
// noopLogger is a placeholder logger that logs nothing. // noopLogger is a placeholder logger that logs nothing.
type noopLogger struct{} type noopLogger struct{}
func (l *noopLogger) Name() string { func (*noopLogger) Name() string {
return "noop" return "noop"
} }
func (l *noopLogger) Level() log.Level { func (*noopLogger) Level() log.Level {
return log.LevelTrace return log.LevelTrace
} }
func (l *noopLogger) Write(log.Messager) error { func (*noopLogger) Write(log.Messager) error {
return nil return nil
} }