mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
21 lines
339 B
Go
21 lines
339 B
Go
package gapi
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
func (c *Client) DeleteUser(id int64) error {
|
|
req, err := c.newRequest("DELETE", fmt.Sprintf("/api/admin/users/%d", id), nil)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
resp, err := c.Do(req)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if resp.StatusCode != 200 {
|
|
return errors.New(resp.Status)
|
|
}
|
|
return err
|
|
}
|