From 7ea7df01a49b9e68ca1940cc53e5a90c38abc685 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Wed, 20 Sep 2023 13:51:54 -0400 Subject: [PATCH] catpb: make JobID implement fmt.Stringer This will make some things nicer (e.g. in roachtest/tests/jobs.go we used %s format directive). Epic: None Release note: None --- pkg/sql/catalog/catpb/job_id.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/sql/catalog/catpb/job_id.go b/pkg/sql/catalog/catpb/job_id.go index 69b3234dd116..17241b16414f 100644 --- a/pkg/sql/catalog/catpb/job_id.go +++ b/pkg/sql/catalog/catpb/job_id.go @@ -10,6 +10,8 @@ package catpb +import "strconv" + // JobID is the ID of a job. It is defined here and imported in jobspb because // jobs are referenced in descriptors and also jobs reference parts of // descriptors. This avoids any dependency cycles. @@ -20,3 +22,8 @@ const InvalidJobID JobID = 0 // SafeValue implements the redact.SafeValue interface. func (j JobID) SafeValue() {} + +// String implements the fmt.Stringer interface. +func (j JobID) String() string { + return strconv.Itoa(int(j)) +}