mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
		| @@ -27,12 +27,11 @@ import ( | ||||
| ) | ||||
|  | ||||
| func withKeyFile(t *testing.T, keyname string, callback func(string)) { | ||||
|  | ||||
| 	tmpDir, err := os.MkdirTemp("", "key-file") | ||||
| 	assert.NoError(t, err) | ||||
| 	defer util.RemoveAll(tmpDir) | ||||
|  | ||||
| 	err = os.Chmod(tmpDir, 0700) | ||||
| 	err = os.Chmod(tmpDir, 0o700) | ||||
| 	assert.NoError(t, err) | ||||
|  | ||||
| 	keyFile := filepath.Join(tmpDir, keyname) | ||||
| @@ -40,10 +39,10 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) { | ||||
| 	assert.NoError(t, err) | ||||
|  | ||||
| 	err = os.WriteFile(path.Join(tmpDir, "ssh"), []byte("#!/bin/bash\n"+ | ||||
| 		"ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0700) | ||||
| 		"ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0o700) | ||||
| 	assert.NoError(t, err) | ||||
|  | ||||
| 	//Setup ssh wrapper | ||||
| 	// Setup ssh wrapper | ||||
| 	os.Setenv("GIT_SSH", path.Join(tmpDir, "ssh")) | ||||
| 	os.Setenv("GIT_SSH_COMMAND", | ||||
| 		"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"") | ||||
| @@ -103,7 +102,7 @@ func onGiteaRunTB(t testing.TB, callback func(testing.TB, *url.URL), prepare ... | ||||
| 	}() | ||||
|  | ||||
| 	go s.Serve(listener) | ||||
| 	//Started by config go ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers, setting.SSH.ServerKeyExchanges, setting.SSH.ServerMACs) | ||||
| 	// Started by config go ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers, setting.SSH.ServerKeyExchanges, setting.SSH.ServerMACs) | ||||
|  | ||||
| 	callback(t, u) | ||||
| } | ||||
| @@ -142,7 +141,7 @@ func doGitInitTestRepository(dstPath string) func(*testing.T) { | ||||
| 		// forcibly set default branch to master | ||||
| 		_, err := git.NewCommand("symbolic-ref", "HEAD", git.BranchPrefix+"master").RunInDir(dstPath) | ||||
| 		assert.NoError(t, err) | ||||
| 		assert.NoError(t, os.WriteFile(filepath.Join(dstPath, "README.md"), []byte(fmt.Sprintf("# Testing Repository\n\nOriginally created in: %s", dstPath)), 0644)) | ||||
| 		assert.NoError(t, os.WriteFile(filepath.Join(dstPath, "README.md"), []byte(fmt.Sprintf("# Testing Repository\n\nOriginally created in: %s", dstPath)), 0o644)) | ||||
| 		assert.NoError(t, git.AddChanges(dstPath, true)) | ||||
| 		signature := git.Signature{ | ||||
| 			Email: "test@example.com", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user