fix Go warnings

This commit is contained in:
Jeffrey Morgan 2023-07-31 21:37:40 -04:00
parent 7da249fcc1
commit 9968153729

View file

@ -635,9 +635,7 @@ func PushModel(name string, regOpts *RegistryOptions, fn func(api.ProgressRespon
} }
var layers []*Layer var layers []*Layer
for _, layer := range manifest.Layers { layers = append(layers, manifest.Layers...)
layers = append(layers, layer)
}
layers = append(layers, &manifest.Config) layers = append(layers, &manifest.Config)
for _, layer := range layers { for _, layer := range layers {
@ -881,7 +879,7 @@ func uploadBlobChunked(mp ModelPath, location string, layer *Layer, regOpts *Reg
// TODO allow cross repo blob mount // TODO allow cross repo blob mount
// Create URL // Create URL
url := fmt.Sprintf("%s", location) url := location
fp, err := GetBlobsPath(layer.Digest) fp, err := GetBlobsPath(layer.Digest)
if err != nil { if err != nil {
@ -931,7 +929,7 @@ func uploadBlobChunked(mp ModelPath, location string, layer *Layer, regOpts *Reg
// Check for success: For a successful upload, the Docker registry will respond with a 201 Created // Check for success: For a successful upload, the Docker registry will respond with a 201 Created
if resp.StatusCode != http.StatusAccepted { if resp.StatusCode != http.StatusAccepted {
fn(api.ProgressResponse{ fn(api.ProgressResponse{
Status: fmt.Sprintf("error uploading layer"), Status: "error uploading layer",
Digest: layer.Digest, Digest: layer.Digest,
Total: int(layer.Size), Total: int(layer.Size),
Completed: int(totalUploaded), Completed: int(totalUploaded),