mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Add an abstract json layout to make it's easier to change json library (#16528)
* Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
This commit is contained in:
		@@ -15,13 +15,13 @@ import (
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/modules/json"
 | 
			
		||||
	"code.gitea.io/gitea/modules/log"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	"code.gitea.io/gitea/modules/storage"
 | 
			
		||||
	"code.gitea.io/gitea/modules/util"
 | 
			
		||||
 | 
			
		||||
	"gitea.com/go-chi/session"
 | 
			
		||||
	jsoniter "github.com/json-iterator/go"
 | 
			
		||||
	archiver "github.com/mholt/archiver/v3"
 | 
			
		||||
	"github.com/urfave/cli"
 | 
			
		||||
)
 | 
			
		||||
@@ -306,7 +306,6 @@ func runDump(ctx *cli.Context) error {
 | 
			
		||||
		var excludes []string
 | 
			
		||||
		if setting.Cfg.Section("session").Key("PROVIDER").Value() == "file" {
 | 
			
		||||
			var opts session.Options
 | 
			
		||||
			json := jsoniter.ConfigCompatibleWithStandardLibrary
 | 
			
		||||
			if err = json.Unmarshal([]byte(setting.SessionConfig.ProviderConfig), &opts); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@ import (
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/modules/json"
 | 
			
		||||
	"code.gitea.io/gitea/modules/log"
 | 
			
		||||
	"code.gitea.io/gitea/modules/pprof"
 | 
			
		||||
	"code.gitea.io/gitea/modules/private"
 | 
			
		||||
@@ -24,7 +25,6 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/services/lfs"
 | 
			
		||||
 | 
			
		||||
	"github.com/golang-jwt/jwt"
 | 
			
		||||
	jsoniter "github.com/json-iterator/go"
 | 
			
		||||
	"github.com/kballard/go-shellquote"
 | 
			
		||||
	"github.com/urfave/cli"
 | 
			
		||||
)
 | 
			
		||||
@@ -265,7 +265,6 @@ func runServ(c *cli.Context) error {
 | 
			
		||||
		}
 | 
			
		||||
		tokenAuthentication.Header["Authorization"] = fmt.Sprintf("Bearer %s", tokenString)
 | 
			
		||||
 | 
			
		||||
		json := jsoniter.ConfigCompatibleWithStandardLibrary
 | 
			
		||||
		enc := json.NewEncoder(os.Stdout)
 | 
			
		||||
		err = enc.Encode(tokenAuthentication)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user