Skip to content

Commit 4c12780

Browse files
committed
webdav: remove runtime check for Go 1.4 or earlier.
During the Go 1.5 development cycle, this package used to require the standard library's encoding/xml package from Go 1.5 or later, but https://go-review.googlesource.com/#/c/12772/ (which was submitted in July 2015) made an internal fork of encoding/xml, as some namespace related changes introduced in the Go 1.5 cycle were rolled back in response to golang/go#11841 Thus, this "go1.4" runtime check is no longer necessary. In the long term, this package should use the standard library's version, and the internal fork deleted, once golang/go#13400 is resolved. We could re-introduce a similar check at that time, although it could be done at compile time (via a "go1.7" build tag) instead of at runtime. Change-Id: I18258443aa3d9b519e23106aedb189f25c35495d Reviewed-on: https://go-review.googlesource.com/21634 Reviewed-by: Andrew Gerrand <[email protected]>
1 parent 19a8091 commit 4c12780

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

webdav/webdav.go

-21
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,14 @@ import (
99
"errors"
1010
"fmt"
1111
"io"
12-
"log"
1312
"net/http"
1413
"net/url"
1514
"os"
1615
"path"
17-
"runtime"
1816
"strings"
1917
"time"
2018
)
2119

22-
// Package webdav's XML output requires the standard library's encoding/xml
23-
// package version 1.5 or greater. Otherwise, it will produce malformed XML.
24-
//
25-
// As of May 2015, the Go stable release is version 1.4, so we print a message
26-
// to let users know that this golang.org/x/etc package won't work yet.
27-
//
28-
// This package also won't work with Go 1.3 and earlier, but making this
29-
// runtime version check catch all the earlier versions too, and not just
30-
// "1.4.x", isn't worth the complexity.
31-
//
32-
// TODO: delete this check at some point after Go 1.5 is released.
33-
var go1Dot4 = strings.HasPrefix(runtime.Version(), "go1.4.")
34-
35-
func init() {
36-
if go1Dot4 {
37-
log.Println("package webdav requires Go version 1.5 or greater")
38-
}
39-
}
40-
4120
type Handler struct {
4221
// Prefix is the URL path prefix to strip from WebDAV resource paths.
4322
Prefix string

webdav/xml_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,6 @@ func TestReadPropfind(t *testing.T) {
348348
}
349349

350350
func TestMultistatusWriter(t *testing.T) {
351-
if go1Dot4 {
352-
t.Skip("TestMultistatusWriter requires Go version 1.5 or greater")
353-
}
354-
355351
///The "section x.y.z" test cases come from section x.y.z of the spec at
356352
// http://www.webdav.org/specs/rfc4918.html
357353
testCases := []struct {

0 commit comments

Comments
 (0)