This commit is contained in:
Josh Yan 2024-07-29 14:37:21 -07:00
parent 18203bf8d8
commit 86a874fceb
4 changed files with 19 additions and 19 deletions

View File

@ -139,7 +139,7 @@ func ParseFile(r io.Reader) (*File, error) {
}
continue
} else if isSpace(r){
} else if isSpace(r) {
return nil, errInvalidVersion
} else if _, err := semver.NewVersion(s); err != nil {
return nil, errInvalidVersion

View File

@ -18,7 +18,7 @@ type Manifest struct {
MediaType string `json:"mediaType"`
Config *Layer `json:"config"`
Layers []*Layer `json:"layers"`
Ollama string `json:"ollama"`
Ollama string `json:"ollama"`
filepath string
fi os.FileInfo
@ -116,7 +116,7 @@ func WriteManifest(name model.Name, config *Layer, layers []*Layer, ollama strin
MediaType: "application/vnd.docker.distribution.manifest.v2+json",
Config: config,
Layers: layers,
Ollama: ollama,
Ollama: ollama,
}
return json.NewEncoder(f).Encode(m)

View File

@ -624,7 +624,7 @@ func TestCreateDetectTemplate(t *testing.T) {
})
}
func TestCreateVersion(t *testing.T){
func TestCreateVersion(t *testing.T) {
gin.SetMode(gin.TestMode)
p := t.TempDir()