[PR #6247] [MERGED] Store layers inside manifests consistently as values. #12063

Closed
opened 2026-04-12 23:48:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6247
Author: @jessegross
Created: 8/8/2024
Status: Merged
Merged: 8/8/2024
Merged by: @jessegross

Base: mainHead: jessegross/layers


📝 Commits (2)

  • 97ec8cf image: Clarify argument to WriteManifest is config
  • 7edaf6e manifest: Store layers inside manifests consistently as values.

📊 Changes

6 files changed (+36 additions, -36 deletions)

View changed files

📝 server/images.go (+10 -10)
📝 server/layer.go (+14 -14)
📝 server/manifest.go (+8 -8)
📝 server/model.go (+1 -1)
📝 server/routes_delete_test.go (+1 -1)
📝 server/upload.go (+2 -2)

📄 Description

This consistently uses layers as values (instead of pointers) inside of manifest after the change to make the config be passed by value. The interface is clearer and it reduces the need dereference and take address of in some places.

I'm not sure if the changes in layer.go are considered canonical Go, so I would appreciate some feedback there. In particular, the New functions return a layer by reference but the receiver functions take a pointer.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/6247 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 8/8/2024 **Status:** ✅ Merged **Merged:** 8/8/2024 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/layers` --- ### 📝 Commits (2) - [`97ec8cf`](https://github.com/ollama/ollama/commit/97ec8cfd4ef13190f3939fbb24b6f146d570ed12) image: Clarify argument to WriteManifest is config - [`7edaf6e`](https://github.com/ollama/ollama/commit/7edaf6e7e8d79a9c88419988ae98afaf3fc32f15) manifest: Store layers inside manifests consistently as values. ### 📊 Changes **6 files changed** (+36 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+10 -10) 📝 `server/layer.go` (+14 -14) 📝 `server/manifest.go` (+8 -8) 📝 `server/model.go` (+1 -1) 📝 `server/routes_delete_test.go` (+1 -1) 📝 `server/upload.go` (+2 -2) </details> ### 📄 Description This consistently uses layers as values (instead of pointers) inside of manifest after the change to make the config be passed by value. The interface is clearer and it reduces the need dereference and take address of in some places. I'm not sure if the changes in layer.go are considered canonical Go, so I would appreciate some feedback there. In particular, the New functions return a layer by reference but the receiver functions take a pointer. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:48:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12063