You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
amd64
go env Output
$ go env
go version
go version go1.13 windows/amd64
C:\Go\src\myPrograms\study-Go>go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\shpathak\AppData\Local\go-build
set GOENV=C:\Users\shpathak\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\shpathak\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Go\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\shpathak\AppData\Local\Temp\go-build079362430=/tmp/go-build -gno-record-gcc-switches
What did you do?
When I execute the below programme , I am getting the output of variable x is x: [1 2 3 10]
But It should be x: [1 2 3 4]
/******
package main
import (
"fmt"
)
func main() {
//case 1
a := []int{}
a = append(a, 1)
a = append(a, 2)
b := append(a, 3)
c := append(a, 4)
fmt.Println("a: ", a, "\nb: ", b, "\nc: ", c)
//case 2
a = append(a, 3)
x := append(a, 4)
y := append(a, 10)
fmt.Println("a: ", a, "\nx: ", x, "\ny: ", y)
}
/**************************/
What did you expect to see?
value of X should be x: [1 2 3 4].
But it is printing x: [1 2 3 10] which is wrong
What did you see instead?
x: [1 2 3 10]
The text was updated successfully, but these errors were encountered:
Unlike other projects, we do not use the issue tracker for questions such as these. It is only used for bugs and feature proposals. I will close this issue, but please feel free to ask it in any of these forums below:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?amd64
go env
OutputWhat did you do?
When I execute the below programme , I am getting the output of variable x is x: [1 2 3 10]
But It should be x: [1 2 3 4]
/******
package main
import (
"fmt"
)
func main() {
//case 1
a := []int{}
a = append(a, 1)
a = append(a, 2)
b := append(a, 3)
c := append(a, 4)
fmt.Println("a: ", a, "\nb: ", b, "\nc: ", c)
}
/**************************/
What did you expect to see?
value of X should be x: [1 2 3 4].
But it is printing x: [1 2 3 10] which is wrong
What did you see instead?
x: [1 2 3 10]
The text was updated successfully, but these errors were encountered: