mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-09-03 09:26:23 -07:00
refactor: unused parameter should be replaced by underscore
Unused parameters in functions or methods should be replaced with `_` (underscore) or removed.
This commit is contained in:
parent
1de30e01b9
commit
1d92be6f63
10 changed files with 13 additions and 13 deletions
|
@ -164,7 +164,7 @@ func (dbu *GCDatabaseUpdater) MigratePosts() error {
|
|||
return gcutil.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (dbu *GCDatabaseUpdater) MigrateStaff(password string) error {
|
||||
func (dbu *GCDatabaseUpdater) MigrateStaff(_ string) error {
|
||||
return gcutil.ErrNotImplemented
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ func (*KusabaXMigrator) MigratePosts() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (*KusabaXMigrator) MigrateStaff(password string) error {
|
||||
func (*KusabaXMigrator) MigrateStaff(_ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ func (m *Pre2021Migrator) MigrateDB() (bool, error) {
|
|||
return true, nil
|
||||
}
|
||||
|
||||
func (*Pre2021Migrator) MigrateStaff(password string) error {
|
||||
func (*Pre2021Migrator) MigrateStaff(_ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ func (*TinyBoardMigrator) MigratePosts() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (*TinyBoardMigrator) MigrateStaff(password string) error {
|
||||
func (*TinyBoardMigrator) MigrateStaff(_ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ func (p *Post) Stickied() bool {
|
|||
return p.thread.Stickied
|
||||
}
|
||||
|
||||
func GetBuildablePost(id int, boardid int) (*Post, error) {
|
||||
func GetBuildablePost(id int, _ int) (*Post, error) {
|
||||
const query = postQueryBase + " AND DBPREFIXposts.id = ?"
|
||||
var post Post
|
||||
var lastBump time.Time
|
||||
|
|
|
@ -131,7 +131,7 @@ func (ipb IPBan) IsGlobalBan() bool {
|
|||
return ipb.BoardID == nil
|
||||
}
|
||||
|
||||
func (ipb *IPBan) Deactivate(staffID int) error {
|
||||
func (ipb *IPBan) Deactivate(_ int) error {
|
||||
const deactivateQuery = `UPDATE DBPREFIXip_ban SET is_active = FALSE WHERE id = ?`
|
||||
const auditInsertQuery = `INSERT INTO DBPREFIXip_ban_audit
|
||||
(ip_ban_id, staff_id, is_active, is_thread_ban, expires_at, appeal_at, permanent, staff_note, message, can_appeal)
|
||||
|
@ -367,13 +367,13 @@ func (ub filenameOrUsernameBanBase) IsGlobalBan() bool {
|
|||
return ub.BoardID == nil
|
||||
}
|
||||
|
||||
func (fnb *FilenameBan) Deactivate(staffID int) error {
|
||||
func (fnb *FilenameBan) Deactivate(_ int) error {
|
||||
const deleteQuery = `DELETE FROM DBPREFIXfilename_ban WHERE id = ?`
|
||||
_, err := ExecSQL(deleteQuery, fnb.ID)
|
||||
return err
|
||||
}
|
||||
|
||||
func (fnb *UsernameBan) Deactivate(staffID int) error {
|
||||
func (fnb *UsernameBan) Deactivate(_ int) error {
|
||||
const deleteQuery = `DELETE FROM DBPREFIXusername_ban WHERE id = ?`
|
||||
_, err := ExecSQL(deleteQuery, fnb.ID)
|
||||
return err
|
||||
|
@ -482,7 +482,7 @@ func (fb *FileBan) IsGlobalBan() bool {
|
|||
return fb.BoardID == nil
|
||||
}
|
||||
|
||||
func (fb FileBan) Deactivate(staffID int) error {
|
||||
func (fb FileBan) Deactivate(_ int) error {
|
||||
const deleteQuery = `DELETE FROM DBPREFIXfile_ban WHERE id = ?`
|
||||
_, err := ExecSQL(deleteQuery, fb.ID)
|
||||
return err
|
||||
|
|
|
@ -18,7 +18,7 @@ var (
|
|||
|
||||
type logHook struct{}
|
||||
|
||||
func (*logHook) Run(e *zerolog.Event, level zerolog.Level, msg string) {
|
||||
func (*logHook) Run(e *zerolog.Event, level zerolog.Level, _ string) {
|
||||
if level != zerolog.Disabled && level != zerolog.NoLevel {
|
||||
e.Timestamp()
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ func getAvailableActions(rank int, noJSON bool) []Action {
|
|||
return available
|
||||
}
|
||||
|
||||
func getStaffActions(writer http.ResponseWriter, request *http.Request, staff *gcsql.Staff, wantsJSON bool, infoEv *zerolog.Event, errEv *zerolog.Event) (interface{}, error) {
|
||||
func getStaffActions(_ http.ResponseWriter, _ *http.Request, staff *gcsql.Staff, _ bool, _ *zerolog.Event, _ *zerolog.Event) (interface{}, error) {
|
||||
availableActions := getAvailableActions(staff.Rank, false)
|
||||
return availableActions, nil
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ func init() {
|
|||
RegisterAdminPages()
|
||||
}
|
||||
|
||||
func dashboardCallback(writer http.ResponseWriter, request *http.Request, staff *gcsql.Staff, wantsJSON bool, infoEv *zerolog.Event, errEv *zerolog.Event) (interface{}, error) {
|
||||
func dashboardCallback(_ http.ResponseWriter, _ *http.Request, staff *gcsql.Staff, _ bool, _ *zerolog.Event, errEv *zerolog.Event) (interface{}, error) {
|
||||
dashBuffer := bytes.NewBufferString("")
|
||||
announcements, err := gcsql.GetAllAccouncements()
|
||||
if err != nil {
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
func showBanpage(ban *gcsql.IPBan, post *gcsql.Post, postBoard *gcsql.Board, writer http.ResponseWriter, request *http.Request) {
|
||||
func showBanpage(ban *gcsql.IPBan, post *gcsql.Post, postBoard *gcsql.Board, writer http.ResponseWriter, _ *http.Request) {
|
||||
banPageBuffer := bytes.NewBufferString("")
|
||||
err := serverutil.MinifyTemplate(gctemplates.Banpage, map[string]interface{}{
|
||||
"systemCritical": config.GetSystemCriticalConfig(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue