mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Update gitea/sdk vendor (#406)
This commit is contained in:
		
				
					committed by
					
						
						Thomas Boerger
					
				
			
			
				
	
			
			
			
						parent
						
							578a8e258e
						
					
				
				
					commit
					b11843b8dc
				
			
							
								
								
									
										11
									
								
								vendor/code.gitea.io/sdk/gitea/user.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/code.gitea.io/sdk/gitea/user.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -5,6 +5,7 @@
 | 
			
		||||
package gitea
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -17,6 +18,16 @@ type User struct {
 | 
			
		||||
	AvatarURL string `json:"avatar_url"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility
 | 
			
		||||
func (u User) MarshalJSON() ([]byte, error) {
 | 
			
		||||
	// Re-declaring User to avoid recursion
 | 
			
		||||
	type shadow User
 | 
			
		||||
	return json.Marshal(struct {
 | 
			
		||||
		shadow
 | 
			
		||||
		CompatUserName string `json:"username"`
 | 
			
		||||
	}{shadow(u), u.UserName})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetUserInfo get user info by user's name
 | 
			
		||||
func (c *Client) GetUserInfo(user string) (*User, error) {
 | 
			
		||||
	u := new(User)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user