mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Drop json-iterator dependency (#35544)
This commit is contained in:
		
							
								
								
									
										34
									
								
								modules/json/jsonv1.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								modules/json/jsonv1.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| // Copyright 2025 The Gitea Authors. All rights reserved. | ||||
| // SPDX-License-Identifier: MIT | ||||
|  | ||||
| package json | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"encoding/json" //nolint:depguard // this package wraps it | ||||
| 	"io" | ||||
| ) | ||||
|  | ||||
| type jsonV1 struct{} | ||||
|  | ||||
| var _ Interface = jsonV1{} | ||||
|  | ||||
| func (jsonV1) Marshal(v any) ([]byte, error) { | ||||
| 	return json.Marshal(v) | ||||
| } | ||||
|  | ||||
| func (jsonV1) Unmarshal(data []byte, v any) error { | ||||
| 	return json.Unmarshal(data, v) | ||||
| } | ||||
|  | ||||
| func (jsonV1) NewEncoder(writer io.Writer) Encoder { | ||||
| 	return json.NewEncoder(writer) | ||||
| } | ||||
|  | ||||
| func (jsonV1) NewDecoder(reader io.Reader) Decoder { | ||||
| 	return json.NewDecoder(reader) | ||||
| } | ||||
|  | ||||
| func (jsonV1) Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error { | ||||
| 	return json.Indent(dst, src, prefix, indent) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user