Skip to content

Commit

Permalink
webdav: remove runtime check for Go 1.4 or earlier.
Browse files Browse the repository at this point in the history
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 <adg@golang.org>
  • Loading branch information
nigeltao committed Apr 7, 2016
1 parent af4fee9 commit e000e3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
21 changes: 0 additions & 21 deletions webdav/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,14 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
"path"
"runtime"
"strings"
"time"
)

// Package webdav's XML output requires the standard library's encoding/xml
// package version 1.5 or greater. Otherwise, it will produce malformed XML.
//
// As of May 2015, the Go stable release is version 1.4, so we print a message
// to let users know that this golang.org/x/etc package won't work yet.
//
// This package also won't work with Go 1.3 and earlier, but making this
// runtime version check catch all the earlier versions too, and not just
// "1.4.x", isn't worth the complexity.
//
// TODO: delete this check at some point after Go 1.5 is released.
var go1Dot4 = strings.HasPrefix(runtime.Version(), "go1.4.")

func init() {
if go1Dot4 {
log.Println("package webdav requires Go version 1.5 or greater")
}
}

type Handler struct {
// Prefix is the URL path prefix to strip from WebDAV resource paths.
Prefix string
Expand Down
4 changes: 0 additions & 4 deletions webdav/xml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ func TestReadPropfind(t *testing.T) {
}

func TestMultistatusWriter(t *testing.T) {
if go1Dot4 {
t.Skip("TestMultistatusWriter requires Go version 1.5 or greater")
}

///The "section x.y.z" test cases come from section x.y.z of the spec at
// http://www.webdav.org/specs/rfc4918.html
testCases := []struct {
Expand Down

0 comments on commit e000e3c

Please sign in to comment.