diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2022-03-06 16:37:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:37:41 +0800 |
commit | 09dbbf9a6989c8045e0297c5d62c9e0c2732c1d9 (patch) | |
tree | 89e87d402ad163d5eaf93cf10824d0cc471654d9 /internal | |
parent | b7372b1f32cd0bb40984debfb049e3fc04efaee4 (diff) |
autofix: fix unused method receiver (#6808)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/assets/public/public.go | 12 | ||||
-rw-r--r-- | internal/auth/github/provider.go | 4 | ||||
-rw-r--r-- | internal/auth/ldap/config.go | 4 | ||||
-rw-r--r-- | internal/auth/pam/pam_stub.go | 2 | ||||
-rw-r--r-- | internal/auth/pam/provider.go | 6 | ||||
-rw-r--r-- | internal/auth/smtp/provider.go | 2 | ||||
-rw-r--r-- | internal/email/message.go | 4 | ||||
-rw-r--r-- | internal/lfsutil/storage.go | 2 | ||||
-rw-r--r-- | internal/route/lfs/basic.go | 2 | ||||
-rw-r--r-- | internal/route/lfs/basic_test.go | 2 | ||||
-rw-r--r-- | internal/testutil/noop_logger.go | 6 |
11 files changed, 23 insertions, 23 deletions
diff --git a/internal/assets/public/public.go b/internal/assets/public/public.go index e1747ff1..4ad92605 100644 --- a/internal/assets/public/public.go +++ b/internal/assets/public/public.go @@ -33,20 +33,20 @@ func (d fileInfo) Size() int64 { return d.size } -func (d fileInfo) Mode() os.FileMode { +func (fileInfo) Mode() os.FileMode { return os.FileMode(0644) | os.ModeDir } -func (d fileInfo) ModTime() time.Time { +func (fileInfo) ModTime() time.Time { return time.Time{} } // IsDir return file whether a directory -func (d *fileInfo) IsDir() bool { +func (*fileInfo) IsDir() bool { return true } -func (d fileInfo) Sys() interface{} { +func (fileInfo) Sys() interface{} { return nil } @@ -59,7 +59,7 @@ type file struct { childrenOffset int } -func (f *file) Close() error { +func (*file) Close() error { return nil } @@ -95,7 +95,7 @@ func (f *file) Stat() (os.FileInfo, error) { // fileSystem implements the http.FileSystem interface. 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] == '/' { name = name[1:] } diff --git a/internal/auth/github/provider.go b/internal/auth/github/provider.go index 4add2e54..eab9aa58 100644 --- a/internal/auth/github/provider.go +++ b/internal/auth/github/provider.go @@ -44,11 +44,11 @@ func (p *Provider) Config() interface{} { return p.config } -func (p *Provider) HasTLS() bool { +func (*Provider) HasTLS() bool { return true } -func (p *Provider) UseTLS() bool { +func (*Provider) UseTLS() bool { return true } diff --git a/internal/auth/ldap/config.go b/internal/auth/ldap/config.go index 79840ee4..4ef6f157 100644 --- a/internal/auth/ldap/config.go +++ b/internal/auth/ldap/config.go @@ -86,7 +86,7 @@ func (c *Config) sanitizedUserDN(username string) (string, bool) { 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 badCharacters := "\x00*\\" if strings.ContainsAny(group, badCharacters) { @@ -97,7 +97,7 @@ func (c *Config) sanitizedGroupFilter(group string) (string, bool) { 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" badCharacters := "\x00()*\\'\"#+;<>" if strings.ContainsAny(groupDn, badCharacters) || strings.HasPrefix(groupDn, " ") || strings.HasSuffix(groupDn, " ") { diff --git a/internal/auth/pam/pam_stub.go b/internal/auth/pam/pam_stub.go index a9da5de6..387e6ed6 100644 --- a/internal/auth/pam/pam_stub.go +++ b/internal/auth/pam/pam_stub.go @@ -11,6 +11,6 @@ import ( "github.com/pkg/errors" ) -func (c *Config) doAuth(_, _ string) error { +func (*Config) doAuth(_, _ string) error { return errors.New("PAM not supported") } diff --git a/internal/auth/pam/provider.go b/internal/auth/pam/provider.go index ad1b7a8c..4cf0d69b 100644 --- a/internal/auth/pam/provider.go +++ b/internal/auth/pam/provider.go @@ -41,14 +41,14 @@ func (p *Provider) Config() interface{} { return p.config } -func (p *Provider) HasTLS() bool { +func (*Provider) HasTLS() bool { return false } -func (p *Provider) UseTLS() bool { +func (*Provider) UseTLS() bool { return false } -func (p *Provider) SkipTLSVerify() bool { +func (*Provider) SkipTLSVerify() bool { return false } diff --git a/internal/auth/smtp/provider.go b/internal/auth/smtp/provider.go index 1a136f0e..719d1067 100644 --- a/internal/auth/smtp/provider.go +++ b/internal/auth/smtp/provider.go @@ -92,7 +92,7 @@ func (p *Provider) Config() interface{} { return p.config } -func (p *Provider) HasTLS() bool { +func (*Provider) HasTLS() bool { return true } diff --git a/internal/email/message.go b/internal/email/message.go index 118e9855..f7266cf7 100644 --- a/internal/email/message.go +++ b/internal/email/message.go @@ -77,7 +77,7 @@ func LoginAuth(username, password string) smtp.Auth { 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 } @@ -97,7 +97,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 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 host, port, err := net.SplitHostPort(opts.Host) diff --git a/internal/lfsutil/storage.go b/internal/lfsutil/storage.go index a357b8a8..be0660fc 100644 --- a/internal/lfsutil/storage.go +++ b/internal/lfsutil/storage.go @@ -45,7 +45,7 @@ type LocalStorage struct { Root string } -func (s *LocalStorage) Storage() Storage { +func (*LocalStorage) Storage() Storage { return StorageLocal } diff --git a/internal/route/lfs/basic.go b/internal/route/lfs/basic.go index 626f5ff0..a0594839 100644 --- a/internal/route/lfs/basic.go +++ b/internal/route/lfs/basic.go @@ -121,7 +121,7 @@ func (h *basicHandler) serveUpload(c *macaron.Context, repo *db.Repository, oid } // 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 defer c.Req.Request.Body.Close() err := json.NewDecoder(c.Req.Request.Body).Decode(&request) diff --git a/internal/route/lfs/basic_test.go b/internal/route/lfs/basic_test.go index f874f536..6343fdcf 100644 --- a/internal/route/lfs/basic_test.go +++ b/internal/route/lfs/basic_test.go @@ -27,7 +27,7 @@ type mockStorage struct { buf *bytes.Buffer } -func (s *mockStorage) Storage() lfsutil.Storage { +func (*mockStorage) Storage() lfsutil.Storage { return "memory" } diff --git a/internal/testutil/noop_logger.go b/internal/testutil/noop_logger.go index bf536f3f..c13ebacd 100644 --- a/internal/testutil/noop_logger.go +++ b/internal/testutil/noop_logger.go @@ -13,15 +13,15 @@ var _ log.Logger = (*noopLogger)(nil) // noopLogger is a placeholder logger that logs nothing. type noopLogger struct{} -func (l *noopLogger) Name() string { +func (*noopLogger) Name() string { return "noop" } -func (l *noopLogger) Level() log.Level { +func (*noopLogger) Level() log.Level { return log.LevelTrace } -func (l *noopLogger) Write(log.Messager) error { +func (*noopLogger) Write(log.Messager) error { return nil } |