diff --git a/plantuml/encode.go b/plantuml/encode.go index f86cd41..8b16d52 100644 --- a/plantuml/encode.go +++ b/plantuml/encode.go @@ -2,7 +2,7 @@ package plantuml import ( "bytes" - "compress/zlib" + "compress/flate" "io" ) @@ -18,7 +18,7 @@ func DeflateAndEncode(text string) (string, error) { // PlantUML server. func DeflateAndEncodeBytes(text []byte) (string, error) { var buf bytes.Buffer - zw, err := zlib.NewWriterLevel(&buf, zlib.BestCompression) + zw, err := flate.NewWriter(&buf, flate.BestCompression) if err != nil { return "", err } diff --git a/plantuml/encode_test.go b/plantuml/encode_test.go index 2e93abf..4f5d31f 100644 --- a/plantuml/encode_test.go +++ b/plantuml/encode_test.go @@ -11,7 +11,7 @@ func TestEncode(t *testing.T) { Bob -> Alice : hello @enduml` - expected := "UDfoA2v9B2efpStXSifFKj2rKt3CoKnELR1Io4ZDoSddSaZDIodDpG44003___W93C00" + expected := "SYWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKifpSq11000__y0" encoded, err := DeflateAndEncode(source)