mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	Replace http method strings with net/http constants (#14677)
This commit is contained in:
		 Anton Averchenkov
					Anton Averchenkov
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							7f36a29e04
						
					
				
				
					commit
					0dd4cda7c9
				
			| @@ -1,6 +1,9 @@ | ||||
| package api | ||||
|  | ||||
| import "context" | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| ) | ||||
|  | ||||
| func (c *Sys) InitStatus() (bool, error) { | ||||
| 	return c.InitStatusWithContext(context.Background()) | ||||
| @@ -10,7 +13,7 @@ func (c *Sys) InitStatusWithContext(ctx context.Context) (bool, error) { | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("GET", "/v1/sys/init") | ||||
| 	r := c.c.NewRequest(http.MethodGet, "/v1/sys/init") | ||||
|  | ||||
| 	resp, err := c.c.rawRequestWithContext(ctx, r) | ||||
| 	if err != nil { | ||||
| @@ -31,7 +34,7 @@ func (c *Sys) InitWithContext(ctx context.Context, opts *InitRequest) (*InitResp | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("PUT", "/v1/sys/init") | ||||
| 	r := c.c.NewRequest(http.MethodPut, "/v1/sys/init") | ||||
| 	if err := r.SetJSONBody(opts); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user