Replace interface{} with any (#2807)

like golang:
2580d0e08d
This commit is contained in:
qwerty287
2023-11-12 18:23:48 +01:00
committed by GitHub
parent fd77b2e9d7
commit 70711ed9db
35 changed files with 106 additions and 106 deletions

View File

@@ -586,17 +586,17 @@ func (c *client) AgentTasksList(agentID int64) ([]*Task, error) {
//
// helper function for making an http GET request.
func (c *client) get(rawurl string, out interface{}) error {
func (c *client) get(rawurl string, out any) error {
return c.do(rawurl, http.MethodGet, nil, out)
}
// helper function for making an http POST request.
func (c *client) post(rawurl string, in, out interface{}) error {
func (c *client) post(rawurl string, in, out any) error {
return c.do(rawurl, http.MethodPost, in, out)
}
// helper function for making an http PATCH request.
func (c *client) patch(rawurl string, in, out interface{}) error {
func (c *client) patch(rawurl string, in, out any) error {
return c.do(rawurl, http.MethodPatch, in, out)
}
@@ -606,7 +606,7 @@ func (c *client) delete(rawurl string) error {
}
// helper function to make an http request
func (c *client) do(rawurl, method string, in, out interface{}) error {
func (c *client) do(rawurl, method string, in, out any) error {
body, err := c.open(rawurl, method, in)
if err != nil {
return err
@@ -619,7 +619,7 @@ func (c *client) do(rawurl, method string, in, out interface{}) error {
}
// helper function to open an http request
func (c *client) open(rawurl, method string, in interface{}) (io.ReadCloser, error) {
func (c *client) open(rawurl, method string, in any) (io.ReadCloser, error) {
uri, err := url.Parse(rawurl)
if err != nil {
return nil, err

View File

@@ -61,10 +61,10 @@ type (
}
PipelineError struct {
Type string `json:"type"`
Message string `json:"message"`
IsWarning bool `json:"is_warning"`
Data interface{} `json:"data"`
Type string `json:"type"`
Message string `json:"message"`
IsWarning bool `json:"is_warning"`
Data any `json:"data"`
}
// Pipeline defines a pipeline object.