From 41fd08ede4de358a6a4514370cfdcb012b4008d6 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 3 Sep 2024 07:02:01 +0300 Subject: [PATCH] Fix typos found by codespell (#284) --- element.go | 2 +- pkg/frame/native.go | 2 +- pkg/personname/groupInfo_test.go | 4 ++-- pkg/uid/uid.go | 2 +- read_test.go | 6 +++--- write.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/element.go b/element.go index b335d02..03f67fc 100644 --- a/element.go +++ b/element.go @@ -59,7 +59,7 @@ func (e *Element) String() string { // Value represents a DICOM value. The underlying data that a Value stores can be determined by inspecting its // ValueType. DICOM values typically can be one of many types (ints, strings, bytes, sequences of other elements, etc), -// so this Value interface attempts to represent this as canoically as possible in Golang (since generics do not exist +// so this Value interface attempts to represent this as canonically as possible in Golang (since generics do not exist // yet). // // Value is JSON serializable out of the box (implements json.Marshaler). diff --git a/pkg/frame/native.go b/pkg/frame/native.go index 04acff8..4b7a2c2 100644 --- a/pkg/frame/native.go +++ b/pkg/frame/native.go @@ -12,7 +12,7 @@ import ( var ErrUnsupportedSamplesPerPixel = errors.New("unsupported samples per pixel") // INativeFrame is an interface representation of NativeFrame[I]'s capabilities, -// and offers a way to use a NativeFrame _without_ requiring propogation of +// and offers a way to use a NativeFrame _without_ requiring propagation of // type parameters. This allows for some more ergonomic signatures, though // NativeFrame[I] can be used directly as well for those who prefer it. type INativeFrame interface { diff --git a/pkg/personname/groupInfo_test.go b/pkg/personname/groupInfo_test.go index 055f609..bf1ee3b 100644 --- a/pkg/personname/groupInfo_test.go +++ b/pkg/personname/groupInfo_test.go @@ -360,7 +360,7 @@ func TestNewPersonNameFromDicom(t *testing.T) { if tc.IsEmpty != parsed.IsEmpty() { t.Errorf( - ".IsEmpty() returned %v, extected %v", + ".IsEmpty() returned %v, expected %v", parsed.IsEmpty(), tc.IsEmpty, ) @@ -387,7 +387,7 @@ func TestGroupInfo_DCM_interiorNullsExceedTrailingLevel(t *testing.T) { } if dcm != "CROUCH^^^^JR" { - t.Errorf("dcm returned uneexpected value: %v", dcm) + t.Errorf("dcm returned unexpected value: %v", dcm) } } diff --git a/pkg/uid/uid.go b/pkg/uid/uid.go index f0eff51..c9a5487 100644 --- a/pkg/uid/uid.go +++ b/pkg/uid/uid.go @@ -43,7 +43,7 @@ func CanonicalTransferSyntaxUID(uid string) (string, error) { } // ParseTransferSyntaxUID parses a transfer syntax uid and returns its byteorder -// and implicitVR/explicitVR type. TrasnferSyntaxUID can be any UID that refers to +// and implicitVR/explicitVR type. TransferSyntaxUID can be any UID that refers to // a transfer syntax. It can be, e.g., 1.2.840.10008.1.2 (it will return // LittleEndian, ImplicitVR) or 1.2.840.10008.1.2.4.54 (it will return // (LittleEndian, ExplicitVR). diff --git a/read_test.go b/read_test.go index 04e5b12..ef8f869 100644 --- a/read_test.go +++ b/read_test.go @@ -751,7 +751,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) { t.Run("NoFileMetaInformationGroupLength", func(t *testing.T) { dcmheaderNoInfoGrpLen, err := headerWithNoFileMetaInformationGroupLength() if err != nil { - t.Fatalf("unsuccesful generation of fake header data") + t.Fatalf("unsuccessful generation of fake header data") } else { r := &reader{ rawReader: dicomio.NewReader(bufio.NewReader(dcmheaderNoInfoGrpLen.HeaderBytes), binary.LittleEndian, int64(dcmheaderNoInfoGrpLen.HeaderBytes.Len())), @@ -772,7 +772,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) { t.Run("WithFileMetaInformationGroupLength", func(t *testing.T) { dcmHeaderInfoGrpLen, err := headerWithFileMetaInformationGroupLength() if err != nil { - t.Fatalf("unsuccesful generation of fake header data with FileMetaInformationGroupLength") + t.Fatalf("unsuccessful generation of fake header data with FileMetaInformationGroupLength") } else { r := &reader{ rawReader: dicomio.NewReader(bufio.NewReader(dcmHeaderInfoGrpLen.HeaderBytes), binary.LittleEndian, int64(dcmHeaderInfoGrpLen.HeaderBytes.Len())), @@ -781,7 +781,7 @@ func TestReadHeader_TryAllowErrorMetaElementGroupLength(t *testing.T) { r.rawReader.SetTransferSyntax(binary.LittleEndian, true) wantElements, err := r.readHeader() if err != nil { - t.Errorf("unsuccesful readHeader when parse option %v is turned on and header has no MetaElementGroupLength tag", opts.allowMissingMetaElementGroupLength) + t.Errorf("unsuccessful readHeader when parse option %v is turned on and header has no MetaElementGroupLength tag", opts.allowMissingMetaElementGroupLength) } // Ensure dataset read from readHeader and the test header are the same except for the ValueLength field. if diff := cmp.Diff(wantElements, dcmHeaderInfoGrpLen.Elements, cmp.AllowUnexported(allValues...), cmpopts.IgnoreFields(Element{}, "ValueLength")); diff != "" { diff --git a/write.go b/write.go index 1c35171..8556060 100644 --- a/write.go +++ b/write.go @@ -358,7 +358,7 @@ func verifyVROrDefault(t tag.Tag, vr string, opts writeOptSet) (string, error) { // Verify the VR on the way out if the caller wants it. if !opts.skipVRVerification && !slices.Contains(tagInfo.VRs, vr) { - return "", fmt.Errorf("ERROR dicomio.veryifyElement: VR mismatch for tag %v. Element.VR=%v, but DICOM standard defines VR to be %v", + return "", fmt.Errorf("ERROR dicomio.verifyElement: VR mismatch for tag %v. Element.VR=%v, but DICOM standard defines VR to be %v", tag.DebugString(t), vr, tagInfo.VRs) }