[PR #5122] [MERGED] Use type switch #17654

Closed
opened 2025-11-02 14:46:35 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5122
Author: @cristaloleg
Created: 10/19/2018
Status: Merged
Merged: 10/19/2018
Merged by: @techknowlogick

Base: masterHead: gocritic-typeSwitchVar


📝 Commits (5)

  • 30cee14 Use type switch
  • 6e3c264 Merge branch 'master' into gocritic-typeSwitchVar
  • 13e04ca Merge branch 'master' into gocritic-typeSwitchVar
  • 1f0df2c Merge branch 'master' into gocritic-typeSwitchVar
  • 910033a Merge branch 'master' into gocritic-typeSwitchVar

📊 Changes

2 files changed (+24 additions, -24 deletions)

View changed files

📝 modules/base/tool.go (+16 -16)
📝 modules/base/tool_test.go (+8 -8)

📄 Description

Found by go-critic typeSwitchVar checker

Log

modules/base/tool.go:444:2 typeSwitchVar case 0 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 1 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 2 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 3 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 4 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 5 can benefit from type switch with assignment
modules/base/tool.go:444:2 typeSwitchVar case 6 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 0 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 1 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 2 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 3 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 4 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 5 can benefit from type switch with assignment
modules/base/tool.go:463:2 typeSwitchVar case 6 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 0 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 1 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 2 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 3 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 4 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 5 can benefit from type switch with assignment
modules/base/tool_test.go:302:3 typeSwitchVar case 6 can benefit from type switch with assignment

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5122 **Author:** [@cristaloleg](https://github.com/cristaloleg) **Created:** 10/19/2018 **Status:** ✅ Merged **Merged:** 10/19/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `gocritic-typeSwitchVar` --- ### 📝 Commits (5) - [`30cee14`](https://github.com/go-gitea/gitea/commit/30cee1465ffb34bca440f918c8da9c8146226ea9) Use type switch - [`6e3c264`](https://github.com/go-gitea/gitea/commit/6e3c2644db4ad3ea683b75d93d244c5b8758ef12) Merge branch 'master' into gocritic-typeSwitchVar - [`13e04ca`](https://github.com/go-gitea/gitea/commit/13e04ca3405462aed349fa5f26ebfd6043d77cfa) Merge branch 'master' into gocritic-typeSwitchVar - [`1f0df2c`](https://github.com/go-gitea/gitea/commit/1f0df2cf85ddaa26d7ccadc0f90071a519c66fbf) Merge branch 'master' into gocritic-typeSwitchVar - [`910033a`](https://github.com/go-gitea/gitea/commit/910033afb74bce292144277aa600dd072612739c) Merge branch 'master' into gocritic-typeSwitchVar ### 📊 Changes **2 files changed** (+24 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `modules/base/tool.go` (+16 -16) 📝 `modules/base/tool_test.go` (+8 -8) </details> ### 📄 Description Found by go-critic typeSwitchVar checker Log ``` modules/base/tool.go:444:2 typeSwitchVar case 0 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 1 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 2 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 3 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 4 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 5 can benefit from type switch with assignment modules/base/tool.go:444:2 typeSwitchVar case 6 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 0 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 1 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 2 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 3 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 4 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 5 can benefit from type switch with assignment modules/base/tool.go:463:2 typeSwitchVar case 6 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 0 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 1 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 2 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 3 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 4 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 5 can benefit from type switch with assignment modules/base/tool_test.go:302:3 typeSwitchVar case 6 can benefit from type switch with assignment ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 14:46:35 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17654