Home | History | Annotate | Download | only in testdata
      1 //gofmt -s
      2 
      3 // Test cases for slice expression simplification.
      4 // Because of a dot import, these slices must remain untouched.
      5 package p
      6 
      7 import . "math"
      8 
      9 var (
     10 	a [10]byte
     11 	b [20]float32
     12 	s []int
     13 	t struct {
     14 		s []byte
     15 	}
     16 
     17 	_ = a[0:]
     18 	_ = a[1:10]
     19 	_ = a[2:len(a)]
     20 	_ = a[3:(len(a))]
     21 	_ = a[len(a) : len(a)-1]
     22 	_ = a[0:len(b)]
     23 
     24 	_ = a[:]
     25 	_ = a[:10]
     26 	_ = a[:len(a)]
     27 	_ = a[:(len(a))]
     28 	_ = a[:len(a)-1]
     29 	_ = a[:len(b)]
     30 
     31 	_ = s[0:]
     32 	_ = s[1:10]
     33 	_ = s[2:len(s)]
     34 	_ = s[3:(len(s))]
     35 	_ = s[len(a) : len(s)-1]
     36 	_ = s[0:len(b)]
     37 
     38 	_ = s[:]
     39 	_ = s[:10]
     40 	_ = s[:len(s)]
     41 	_ = s[:(len(s))]
     42 	_ = s[:len(s)-1]
     43 	_ = s[:len(b)]
     44 
     45 	_ = t.s[0:]
     46 	_ = t.s[1:10]
     47 	_ = t.s[2:len(t.s)]
     48 	_ = t.s[3:(len(t.s))]
     49 	_ = t.s[len(a) : len(t.s)-1]
     50 	_ = t.s[0:len(b)]
     51 
     52 	_ = t.s[:]
     53 	_ = t.s[:10]
     54 	_ = t.s[:len(t.s)]
     55 	_ = t.s[:(len(t.s))]
     56 	_ = t.s[:len(t.s)-1]
     57 	_ = t.s[:len(b)]
     58 )
     59 
     60 func _() {
     61 	s := s[0:len(s)]
     62 	_ = s
     63 }
     64