From 5d89ad4de29c0bbc56d58be48509d65f38113fff Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Tue, 19 May 2026 16:19:24 +0300 Subject: [PATCH] gpt: examples should use index-1-based Signed-off-by: Avi Deitcher --- example_test.go | 1 + examples/efi_create.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/example_test.go b/example_test.go index b45e45c3..5832349b 100644 --- a/example_test.go +++ b/example_test.go @@ -84,6 +84,7 @@ func ExampleCreate_gpt() { ProtectiveMBR: true, Partitions: []*gpt.Partition{ { + Index: 1, Start: 1 * 1024 * 1024 / 512, Size: 10 * 1024 * 1024, Type: gpt.MBRPartitionScheme, diff --git a/examples/efi_create.go b/examples/efi_create.go index cd31026f..b7a4051c 100644 --- a/examples/efi_create.go +++ b/examples/efi_create.go @@ -31,7 +31,7 @@ func CreateEfi(diskImg string) { // create a partition table table := &gpt.Table{ Partitions: []*gpt.Partition{ - {Start: uint64(partitionStart), End: uint64(partitionEnd), Type: gpt.EFISystemPartition, Name: "EFI System"}, + {Index: 1, Start: uint64(partitionStart), End: uint64(partitionEnd), Type: gpt.EFISystemPartition, Name: "EFI System"}, }, } // apply the partition table