2009-07-09 13:08:50 -06:00
|
|
|
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug168
|
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2010-03-30 11:34:57 -06:00
|
|
|
var g byte = 123
|
|
|
|
var f *byte = &g
|
|
|
|
var b = make([]byte, 5)
|
2009-07-09 13:08:50 -06:00
|
|
|
|
|
|
|
func main() {
|
2010-03-30 11:34:57 -06:00
|
|
|
b[0:1][0] = *f
|
2009-07-09 13:08:50 -06:00
|
|
|
if b[0] != 123 {
|
2010-03-30 11:34:57 -06:00
|
|
|
println("want 123 got", b[0])
|
|
|
|
panic("fail")
|
|
|
|
}
|
2009-07-09 13:08:50 -06:00
|
|
|
}
|