[GH-ISSUE #130] Panic in checkid function #22

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

Originally created by @pgporada on GitHub (Jul 23, 2021).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/130

Buitl from current master branch

$ ./proxmox-api-go -debug -insecure checkid
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.main()
	/home/user/proxmox-api-go/main.go:256 +0x3cd5

If I pass a value, then checkid works as intended.

$ ./proxmox-api-go -debug -insecure checkid 120
{"data":null,"errors":{"vmid":"VM 120 already exists"}}

$ ./proxmox-api-go -debug -insecure checkid 121
{"data":"121"}
2021/07/23 15:53:56 Selected ID is free: 121

There should be a test for these cases.

Originally created by @pgporada on GitHub (Jul 23, 2021). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/130 Buitl from current master branch ``` $ ./proxmox-api-go -debug -insecure checkid panic: runtime error: index out of range [1] with length 1 goroutine 1 [running]: main.main() /home/user/proxmox-api-go/main.go:256 +0x3cd5 ``` If I pass a value, then checkid works as intended. ``` $ ./proxmox-api-go -debug -insecure checkid 120 {"data":null,"errors":{"vmid":"VM 120 already exists"}} $ ./proxmox-api-go -debug -insecure checkid 121 {"data":"121"} 2021/07/23 15:53:56 Selected ID is free: 121 ``` There should be a test for these cases.
kerem closed this issue 2026-02-28 00:40:13 +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#22
No description provided.