xhd2015/xgo

test-explorer: updating path overlapped

xhd2015 opened this issue · 0 comments

Previous append to the same paths gets overlapped by later append:

package main

import "fmt"

func main() {
	fmt.Printf("hello world\n")

	base := make([]string, 0, 4)
	base = append(base, []string{"A", "B", "C"}...)

	a := append(base, "a")
	b := append(base, "b")

	fmt.Printf("%v\n", a)
	fmt.Printf("%v\n", b)
	// Output:
	//  [A B C b]
	//  [A B C b]
}

Workaround:

a=append([]string{}, a...)
b=append([]string{}, b...)