weldr: update our use of BurntSushi/toml

The old method is deprecated and failing the linter.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-04-07 20:07:29 +02:00 committed by Alexander Todorov
parent 32f3d3d66e
commit a3c207945f
2 changed files with 4 additions and 4 deletions

View file

@ -1902,7 +1902,7 @@ func (api *API) blueprintsNewHandler(writer http.ResponseWriter, request *http.R
if contentType[0] == "application/json" {
err = json.NewDecoder(request.Body).Decode(&blueprint)
} else if contentType[0] == "text/x-toml" {
_, err = toml.DecodeReader(request.Body, &blueprint)
_, err = toml.NewDecoder(request.Body).Decode(&blueprint)
} else {
err = errors_package.New("blueprint must be in json or toml format")
}
@ -1975,7 +1975,7 @@ func (api *API) blueprintsWorkspaceHandler(writer http.ResponseWriter, request *
if contentType[0] == "application/json" {
err = json.NewDecoder(request.Body).Decode(&blueprint)
} else if contentType[0] == "text/x-toml" {
_, err = toml.DecodeReader(request.Body, &blueprint)
_, err = toml.NewDecoder(request.Body).Decode(&blueprint)
} else {
err = errors_package.New("blueprint must be in json or toml format")
}