Repository: jhillyerd/enmime
Pull request #351 (2024-09-07 16:52:35)

chore!: go mod path to v2 for breaking API changes
Signed-off-by: James Hillyerd <james@hillyerd.com>


coveralls: 
[![Coverage Status](https://coveralls.io/builds/69666914/badge)](https://coveralls.io/builds/69666914)

coverage: 86.536%. remained the same
when pulling **ac9d713692a933087eec7f5d4763c85d1ff9c391 on modv2**
into **ea3bdd64bf40b9efaddad8e9dbc8e42a61688a16 on main**.


Patch:
diff --git a/builder.go b/builder.go
index cfde3ff..5f68377 100644
--- a/builder.go
+++ b/builder.go
@@ -13,7 +13,7 @@ import (
 	"reflect"
 	"time"
 
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 )
 
 // MailBuilder facilitates the easy construction of a MIME message.  Each manipulation method
diff --git a/cmd/mime-dump/mime-dump.go b/cmd/mime-dump/mime-dump.go
index 86f38fd..afa28b7 100644
--- a/cmd/mime-dump/mime-dump.go
+++ b/cmd/mime-dump/mime-dump.go
@@ -7,8 +7,8 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/cmd"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/cmd"
 )
 
 type dumper struct {
diff --git a/cmd/mime-extractor/mime-extractor.go b/cmd/mime-extractor/mime-extractor.go
index 933b306..4155569 100644
--- a/cmd/mime-extractor/mime-extractor.go
+++ b/cmd/mime-extractor/mime-extractor.go
@@ -8,8 +8,8 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/cmd"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/cmd"
 )
 
 var (
diff --git a/cmd/utils.go b/cmd/utils.go
index 57dd26b..e324879 100644
--- a/cmd/utils.go
+++ b/cmd/utils.go
@@ -8,7 +8,7 @@ import (
 	"sort"
 	"strings"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 // AddressHeaders enumerates SMTP headers that contain email addresses
diff --git a/detect.go b/detect.go
index 1dda921..e7aacfa 100644
--- a/detect.go
+++ b/detect.go
@@ -3,7 +3,7 @@ package enmime
 import (
 	"strings"
 
-	inttp "github.com/jhillyerd/enmime/internal/textproto"
+	inttp "github.com/jhillyerd/enmime/v2/internal/textproto"
 )
 
 // detectMultipartMessage returns true if the message has a recognized multipart Content-Type header
diff --git a/dsn/dsn.go b/dsn/dsn.go
index 80b3ab6..c0b0a62 100644
--- a/dsn/dsn.go
+++ b/dsn/dsn.go
@@ -5,7 +5,7 @@ package dsn
 import (
 	"strings"
 
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 )
 
 // Report represents delivery status report as per https://datatracker.ietf.org/doc/html/rfc6522.
diff --git a/dsn/parse.go b/dsn/parse.go
index 054f762..1d1d9af 100644
--- a/dsn/parse.go
+++ b/dsn/parse.go
@@ -7,8 +7,8 @@ import (
 	"fmt"
 	"io"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 )
 
 // ParseReport parses p as a "container" for delivery status report (per rfc6522) if p is "multipart/report".
diff --git a/encode.go b/encode.go
index eab4dd7..39d2a32 100644
--- a/encode.go
+++ b/encode.go
@@ -11,8 +11,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/jhillyerd/enmime/internal/coding"
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 )
 
 // b64Percent determines the percent of non-ASCII characters enmime will tolerate before switching
diff --git a/enmime.go b/enmime.go
index 42b9330..276497d 100644
--- a/enmime.go
+++ b/enmime.go
@@ -51,7 +51,7 @@
 // multi-gigabyte attachments.
 //
 // enmime is open source software released under the MIT License.  The latest version can be found
-// at https://github.com/jhillyerd/enmime
+// at https://github.com/jhillyerd/enmime/v2
 //
 // [1]: https://github.com/jaytaylor/html2text
-package enmime // import "github.com/jhillyerd/enmime"
+package enmime // import "github.com/jhillyerd/enmime/v2"
diff --git a/envelope.go b/envelope.go
index db11457..c717cbe 100644
--- a/envelope.go
+++ b/envelope.go
@@ -10,8 +10,8 @@ import (
 	"time"
 
 	"github.com/jaytaylor/html2text"
-	"github.com/jhillyerd/enmime/internal/coding"
-	inttp "github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	inttp "github.com/jhillyerd/enmime/v2/internal/textproto"
 	"github.com/pkg/errors"
 )
 
diff --git a/go.mod b/go.mod
index f82a689..56148a6 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/jhillyerd/enmime
+module github.com/jhillyerd/enmime/v2
 
 go 1.20
 
diff --git a/header.go b/header.go
index 21744c5..16d7575 100644
--- a/header.go
+++ b/header.go
@@ -9,10 +9,10 @@ import (
 	"net/textproto"
 	"strings"
 
-	"github.com/jhillyerd/enmime/internal/coding"
-	"github.com/jhillyerd/enmime/internal/stringutil"
-	inttp "github.com/jhillyerd/enmime/internal/textproto"
-	"github.com/jhillyerd/enmime/mediatype"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
+	inttp "github.com/jhillyerd/enmime/v2/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/mediatype"
 
 	"github.com/pkg/errors"
 )
diff --git a/inspect.go b/inspect.go
index 268d570..8954211 100644
--- a/inspect.go
+++ b/inspect.go
@@ -5,8 +5,8 @@ import (
 	"bytes"
 	"io"
 
-	"github.com/jhillyerd/enmime/internal/coding"
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 
 	"github.com/pkg/errors"
 )
diff --git a/mediatype/mediatype.go b/mediatype/mediatype.go
index 0b0dc84..c2b49b4 100644
--- a/mediatype/mediatype.go
+++ b/mediatype/mediatype.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	_utf8 "unicode/utf8"
 
-	"github.com/jhillyerd/enmime/internal/coding"
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 	"github.com/pkg/errors"
 )
 
diff --git a/part.go b/part.go
index 9e72ea4..d5eef85 100644
--- a/part.go
+++ b/part.go
@@ -13,9 +13,9 @@ import (
 	"time"
 
 	"github.com/gogs/chardet"
-	"github.com/jhillyerd/enmime/internal/coding"
-	inttp "github.com/jhillyerd/enmime/internal/textproto"
-	"github.com/jhillyerd/enmime/mediatype"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
+	inttp "github.com/jhillyerd/enmime/v2/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/mediatype"
 	"github.com/pkg/errors"
 )
 


Test patch:
diff --git a/builder_test.go b/builder_test.go
index 53abc6c..435d3d5 100644
--- a/builder_test.go
+++ b/builder_test.go
@@ -10,8 +10,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/test"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/test"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/cmd/example_test.go b/cmd/example_test.go
index acd7678..1547864 100644
--- a/cmd/example_test.go
+++ b/cmd/example_test.go
@@ -5,8 +5,8 @@ import (
 	"os"
 	"strings"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/cmd"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/cmd"
 )
 
 func Example() {
diff --git a/cmd/utils_test.go b/cmd/utils_test.go
index b17d1a1..af8b76b 100644
--- a/cmd/utils_test.go
+++ b/cmd/utils_test.go
@@ -5,7 +5,7 @@ import (
 	"bytes"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 func TestMarkdownH1(t *testing.T) {
diff --git a/detect_test.go b/detect_test.go
index aba9b1f..df619b8 100644
--- a/detect_test.go
+++ b/detect_test.go
@@ -5,7 +5,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 )
 
 func TestDetectSinglePart(t *testing.T) {
diff --git a/dsn/example_test.go b/dsn/example_test.go
index 386941c..64c3491 100644
--- a/dsn/example_test.go
+++ b/dsn/example_test.go
@@ -4,8 +4,8 @@ import (
 	"fmt"
 	"os"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/dsn"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/dsn"
 )
 
 // ExampleParseReport shows how to parse message as Delivery Status Notification (DSN).
diff --git a/dsn/parse_internal_test.go b/dsn/parse_internal_test.go
index f7fb62b..b339890 100644
--- a/dsn/parse_internal_test.go
+++ b/dsn/parse_internal_test.go
@@ -3,8 +3,8 @@ package dsn
 import (
 	"testing"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 
 	"github.com/stretchr/testify/assert"
 )
diff --git a/dsn/parse_test.go b/dsn/parse_test.go
index 95defc7..7ee0f52 100644
--- a/dsn/parse_test.go
+++ b/dsn/parse_test.go
@@ -6,9 +6,9 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/dsn"
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/dsn"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/encode_test.go b/encode_test.go
index 0e87e21..188a296 100644
--- a/encode_test.go
+++ b/encode_test.go
@@ -7,8 +7,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/test"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/test"
 )
 
 func TestEncodePartEmpty(t *testing.T) {
diff --git a/envelope_test.go b/envelope_test.go
index bc351e6..a8eb9c2 100644
--- a/envelope_test.go
+++ b/envelope_test.go
@@ -10,8 +10,8 @@ import (
 	"time"
 
 	"github.com/go-test/deep"
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/test"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/test"
 )
 
 func TestParseHeaderOnly(t *testing.T) {
diff --git a/example_test.go b/example_test.go
index a16354d..03df265 100644
--- a/example_test.go
+++ b/example_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 // ExampleBuilder illustrates how to build and send a MIME encoded message.
diff --git a/header_test.go b/header_test.go
index fc1863b..7eba53f 100644
--- a/header_test.go
+++ b/header_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/textproto"
+	"github.com/jhillyerd/enmime/v2/internal/textproto"
 )
 
 // Test re-encoding to base64
diff --git a/inspect_test.go b/inspect_test.go
index 97a6350..5222a44 100644
--- a/inspect_test.go
+++ b/inspect_test.go
@@ -8,8 +8,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/test"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/test"
 )
 
 func TestDecodeRFC2047(t *testing.T) {
diff --git a/internal/coding/base64_test.go b/internal/coding/base64_test.go
index 26c9acc..942ddc2 100644
--- a/internal/coding/base64_test.go
+++ b/internal/coding/base64_test.go
@@ -5,7 +5,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
 )
 
 func TestBase64Cleaner(t *testing.T) {
diff --git a/internal/coding/charsets_test.go b/internal/coding/charsets_test.go
index 040d718..45c5d18 100644
--- a/internal/coding/charsets_test.go
+++ b/internal/coding/charsets_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
 )
 
 // Test an invalid character set with the CharsetReader
diff --git a/internal/coding/idheader_test.go b/internal/coding/idheader_test.go
index a099028..93c9b80 100644
--- a/internal/coding/idheader_test.go
+++ b/internal/coding/idheader_test.go
@@ -3,7 +3,7 @@ package coding_test
 import (
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
 )
 
 func TestFromIDHeader(t *testing.T) {
diff --git a/internal/coding/quotedprint_test.go b/internal/coding/quotedprint_test.go
index d3f4d59..ebf06a4 100644
--- a/internal/coding/quotedprint_test.go
+++ b/internal/coding/quotedprint_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/coding"
+	"github.com/jhillyerd/enmime/v2/internal/coding"
 )
 
 func TestQPCleaner(t *testing.T) {
diff --git a/internal/stringutil/addr_test.go b/internal/stringutil/addr_test.go
index dcff316..0ce4eac 100644
--- a/internal/stringutil/addr_test.go
+++ b/internal/stringutil/addr_test.go
@@ -4,7 +4,7 @@ import (
 	"net/mail"
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 )
 
 func TestJoinAddressEmpty(t *testing.T) {
diff --git a/internal/stringutil/uuid_test.go b/internal/stringutil/uuid_test.go
index 4ad68e7..5f2c65d 100644
--- a/internal/stringutil/uuid_test.go
+++ b/internal/stringutil/uuid_test.go
@@ -3,7 +3,7 @@ package stringutil_test
 import (
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/stringutil/wrap_test.go b/internal/stringutil/wrap_test.go
index 5f39ff5..1a07b38 100644
--- a/internal/stringutil/wrap_test.go
+++ b/internal/stringutil/wrap_test.go
@@ -3,7 +3,7 @@ package stringutil_test
 import (
 	"testing"
 
-	"github.com/jhillyerd/enmime/internal/stringutil"
+	"github.com/jhillyerd/enmime/v2/internal/stringutil"
 )
 
 func TestWrapEmpty(t *testing.T) {
diff --git a/internal/test/testing.go b/internal/test/testing.go
index 26f52b4..23915b6 100644
--- a/internal/test/testing.go
+++ b/internal/test/testing.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 // PartExists indicates to ComparePart that this part is expect to exist
diff --git a/internal/test/testing_test.go b/internal/test/testing_test.go
index c921af0..4548ea2 100644
--- a/internal/test/testing_test.go
+++ b/internal/test/testing_test.go
@@ -5,7 +5,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 func TestHelperComparePartsEqual(t *testing.T) {
diff --git a/part_test.go b/part_test.go
index e67aa0c..e83c8ff 100644
--- a/part_test.go
+++ b/part_test.go
@@ -4,8 +4,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
-	"github.com/jhillyerd/enmime/internal/test"
+	"github.com/jhillyerd/enmime/v2"
+	"github.com/jhillyerd/enmime/v2/internal/test"
 )
 
 func TestPlainTextPart(t *testing.T) {
diff --git a/randoption_test.go b/randoption_test.go
index adff889..6144a38 100644
--- a/randoption_test.go
+++ b/randoption_test.go
@@ -6,7 +6,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/sender_test.go b/sender_test.go
index 01da312..069f675 100644
--- a/sender_test.go
+++ b/sender_test.go
@@ -5,7 +5,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/jhillyerd/enmime"
+	"github.com/jhillyerd/enmime/v2"
 )
 
 func TestSMTPSend(t *testing.T) {