Skip to content

os: RemoveAll possible regression with empty path #28830

@mhilton

Description

@mhilton

What version of Go are you using (go version)?

$ go version
go version devel +14608976db Thu Nov 15 23:37:20 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

No - release 1.11.2 behaves as before

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mhilton/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mhilton/go"
GOPROXY=""
GORACE=""
GOROOT="/home/mhilton/opt/go"
GOTMPDIR=""
GOTOOLDIR="/home/mhilton/opt/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build335628538=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package main

import (
	"fmt"
	"os"
)

func main() {
	err := os.RemoveAll("")
	fmt.Printf("%v\n", err)
}

What did you expect to see?

Go 1.11.2 has the output <nil> - indicating no error returned

What did you see instead?

Tip has the output invalid argument - indicating syscall.EINVAL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions