mirror of
https://github.com/go-gitea/gitea
synced 2025-07-28 13:18:37 +00:00
Simplify parameter types (#18006)
Remove repeated type declarations in function definitions.
This commit is contained in:
@@ -41,7 +41,7 @@ const (
|
||||
)
|
||||
|
||||
// setCompareContext sets context data.
|
||||
func setCompareContext(ctx *context.Context, base *git.Commit, head *git.Commit, headOwner, headName string) {
|
||||
func setCompareContext(ctx *context.Context, base, head *git.Commit, headOwner, headName string) {
|
||||
ctx.Data["BaseCommit"] = base
|
||||
ctx.Data["HeadCommit"] = head
|
||||
|
||||
@@ -73,7 +73,7 @@ func RawCommitURL(owner, name string, commit *git.Commit) string {
|
||||
}
|
||||
|
||||
// setPathsCompareContext sets context data for source and raw paths
|
||||
func setPathsCompareContext(ctx *context.Context, base *git.Commit, head *git.Commit, headOwner, headName string) {
|
||||
func setPathsCompareContext(ctx *context.Context, base, head *git.Commit, headOwner, headName string) {
|
||||
ctx.Data["SourcePath"] = SourceCommitURL(headOwner, headName, head)
|
||||
ctx.Data["RawPath"] = RawCommitURL(headOwner, headName, head)
|
||||
if base != nil {
|
||||
@@ -849,7 +849,7 @@ func ExcerptBlob(ctx *context.Context) {
|
||||
ctx.HTML(http.StatusOK, tplBlobExcerpt)
|
||||
}
|
||||
|
||||
func getExcerptLines(commit *git.Commit, filePath string, idxLeft int, idxRight int, chunkSize int) ([]*gitdiff.DiffLine, error) {
|
||||
func getExcerptLines(commit *git.Commit, filePath string, idxLeft, idxRight, chunkSize int) ([]*gitdiff.DiffLine, error) {
|
||||
blob, err := commit.Tree.GetBlobByPath(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@@ -52,7 +52,7 @@ func renderCommitRights(ctx *context.Context) bool {
|
||||
|
||||
// getParentTreeFields returns list of parent tree names and corresponding tree paths
|
||||
// based on given tree path.
|
||||
func getParentTreeFields(treePath string) (treeNames []string, treePaths []string) {
|
||||
func getParentTreeFields(treePath string) (treeNames, treePaths []string) {
|
||||
if len(treePath) == 0 {
|
||||
return treeNames, treePaths
|
||||
}
|
||||
|
@@ -734,7 +734,7 @@ func getFileContentFromDefaultBranch(ctx *context.Context, filename string) (str
|
||||
return string(bytes), true
|
||||
}
|
||||
|
||||
func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleDirs []string, possibleFiles []string) {
|
||||
func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleDirs, possibleFiles []string) {
|
||||
templateCandidates := make([]string, 0, len(possibleFiles))
|
||||
if ctx.FormString("template") != "" {
|
||||
for _, dirName := range possibleDirs {
|
||||
|
Reference in New Issue
Block a user