...

Source file src/cmd/link/internal/ld/testdata/deadcode/globalmap.go

Documentation: cmd/link/internal/ld/testdata/deadcode

     1  package main
     2  
     3  import "os"
     4  
     5  // Too small to trigger deadcode (currently)
     6  var small = map[string]int{"foo": 1}
     7  
     8  // Has side effects, which prevent deadcode
     9  var effect = map[string]int{"foo": os.Getpid()}
    10  
    11  // Large and side-effect free
    12  var large = map[string]int{
    13  	"11": 1, "12": 2, "13": 3, "14": 4, "15": 5, "16": 6, "17": 7, "18": 8, "19": 9, "110": 10,
    14  	"21": 1, "22": 2, "23": 3, "24": 4, "25": 5, "26": 6, "27": 7, "28": 8, "29": 9, "210": 10,
    15  	"31": 1, "32": 2, "33": 3, "34": 4, "35": 5, "36": 6, "37": 7, "38": 8, "39": 9, "310": 10,
    16  	"41": 1, "42": 2, "43": 3, "44": 4, "45": 5, "46": 6, "47": 7, "48": 8, "49": 9, "410": 10,
    17  	"51": 1, "52": 2, "53": 3, "54": 4, "55": 5, "56": 6, "57": 7, "58": 8, "59": 9, "510": 10,
    18  	"61": 1, "62": 2, "63": 3, "64": 4, "65": 5, "66": 6, "67": 7, "68": 8, "69": 9, "610": 10,
    19  	"71": 1, "72": 2, "73": 3, "74": 4, "75": 5, "76": 6, "77": 7, "78": 8, "79": 9, "710": 10,
    20  	"81": 1, "82": 2, "83": 3, "84": 4, "85": 5, "86": 6, "87": 7, "88": 8, "89": 9, "810": 10,
    21  	"91": 1, "92": 2, "93": 3, "94": 4, "95": 5, "96": 6, "97": 7, "98": 8, "99": 9, "910": 10,
    22  	"101": 1, "102": 2, "103": 3, "104": 4, "105": 5, "106": 6, "107": 7, "108": 8, "109": 9, "1010": 10, "1021": 2,
    23  }
    24  
    25  func main() {
    26  }
    27  

View as plain text