From 032237261d2405f5fe6fee94275890ece6ecd2fb Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 7 Jan 2024 03:56:32 +0100 Subject: [PATCH] remove old compress workaround needed for pre Go 1.7 --- common/block.go | 6 +++--- common/post17offset.go | 10 ---------- common/pre17offset.go | 10 ---------- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 common/post17offset.go delete mode 100644 common/pre17offset.go diff --git a/common/block.go b/common/block.go index 1afe6fe..f81bb6c 100644 --- a/common/block.go +++ b/common/block.go @@ -276,9 +276,9 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error) // There is a bug before Go 1.7 that enforces // to add 4 as an offset after the compressed - // geometry data. This is resolved via build tags - // and definitions in pre17offset.go and - // post17offset.go. + // geometry data. As we now require at least 1.20 + // this is no longer an issue. + const afterCompressOfs = 0 offset += buf.Pos + afterCompressOfs buf.Pos = 0 if offset >= dataLen { diff --git a/common/post17offset.go b/common/post17offset.go deleted file mode 100644 index 6d9691c..0000000 --- a/common/post17offset.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2016 by Sascha L. Teichmann -// Use of this source code is governed by the MIT license -// that can be found in the LICENSE file. - -// +build go1.7 - -package common - -// afterCompressOfs is not necessary after Go 1.7. -const afterCompressOfs = 0 diff --git a/common/pre17offset.go b/common/pre17offset.go deleted file mode 100644 index b7d9a30..0000000 --- a/common/pre17offset.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2016 by Sascha L. Teichmann -// Use of this source code is governed by the MIT license -// that can be found in the LICENSE file. - -// +build !go1.7 - -package common - -// afterCompressOfs is necessary before Go 1.7. -const afterCompressOfs = 4