[PR #267] [MERGED] Refactor: Snapshots #357

Closed
opened 2026-02-28 00:41:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/267
Author: @Tinyblargon
Created: 6/8/2023
Status: Merged
Merged: 6/8/2023
Merged by: @mleone87

Base: masterHead: Refactor-Snapshot


📝 Commits (2)

  • 3429311 make CreateSnapshot() use `VmRef1 as input
  • 621fed4 Change pointer to normal variable

📊 Changes

2 files changed (+10 additions, -5 deletions)

View changed files

📝 cli/command/create/create-snapshot.go (+7 -1)
📝 proxmox/snapshot.go (+3 -4)

📄 Description

Noticed that CreateSnapshot() was the only function in snapshot.go that did not use VmRef as input and would create its own VmRef.

Also changed (config *ConfigSnapshot) CreateSnapshot() to (config ConfigSnapshot) CreateSnapshot() as there is no benefit for having the pointer there, since it never needs to be mutated by multiple functions and its too small to be worth the overhead of creating 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/Telmate/proxmox-api-go/pull/267 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 6/8/2023 **Status:** ✅ Merged **Merged:** 6/8/2023 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `Refactor-Snapshot` --- ### 📝 Commits (2) - [`3429311`](https://github.com/Telmate/proxmox-api-go/commit/34293114d9937dd458d8a13e72a5db55521340a2) make `CreateSnapshot()` use `VmRef1 as input - [`621fed4`](https://github.com/Telmate/proxmox-api-go/commit/621fed467c590b38485944a427e751927c3bb35a) Change pointer to normal variable ### 📊 Changes **2 files changed** (+10 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cli/command/create/create-snapshot.go` (+7 -1) 📝 `proxmox/snapshot.go` (+3 -4) </details> ### 📄 Description Noticed that `CreateSnapshot()` was the only function in [snapshot.go](https://github.com/Telmate/proxmox-api-go/blob/694b457efb6e309cb3d53c1a853c371cba7bbf29/proxmox/snapshot.go) that did not use `VmRef` as input and would create its own `VmRef`. Also changed `(config *ConfigSnapshot) CreateSnapshot()` to `(config ConfigSnapshot) CreateSnapshot()` as there is no benefit for having the pointer there, since it never needs to be mutated by multiple functions and its too small to be worth the overhead of creating a pointer. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#357
No description provided.