blob: d19e6c34443372900721fe26cdc6dafcc18c53ea [file] [log] [blame]
 // errorcheck // Copyright 2017 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. // Ensure that typed non-integer, negative and too large // values are not accepted as size argument in make for // maps. package main type T map[int]int var sink T func main() { sink = make(T, -1) // ERROR "negative size argument in make.*" sink = make(T, uint64(1<<63)) // ERROR "size argument too large in make.*" // Test that errors are emitted at call sites, not const declarations const x = -1 sink = make(T, x) // ERROR "negative size argument in make.*" const y = uint64(1 << 63) sink = make(T, y) // ERROR "size argument too large in make.*" sink = make(T, 0.5) // ERROR "constant 0.5 truncated to integer" sink = make(T, 1.0) sink = make(T, float32(1.0)) // ERROR "non-integer size argument in make.*" sink = make(T, float64(1.0)) // ERROR "non-integer size argument in make.*" sink = make(T, 1.0) sink = make(T, float32(1.0)) // ERROR "non-integer size argument in make.*" sink = make(T, float64(1.0)) // ERROR "non-integer size argument in make.*" sink = make(T, 1+0i) sink = make(T, complex64(1+0i)) // ERROR "non-integer size argument in make.*" sink = make(T, complex128(1+0i)) // ERROR "non-integer size argument in make.*" sink = make(T, 1+0i) sink = make(T, complex64(1+0i)) // ERROR "non-integer size argument in make.*" sink = make(T, complex128(1+0i)) // ERROR "non-integer size argument in make.*" }
{"ft_lang_label":"__label__en","ft_lang_prob":0.5960505,"math_prob":0.9966951,"size":1526,"snap":"2019-26-2019-30","text_gpt3_token_len":476,"char_repetition_ratio":0.25689882,"word_repetition_ratio":0.477551,"special_character_ratio":0.37090433,"punctuation_ratio":0.14191419,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98420143,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-06-16T21:23:08Z\",\"WARC-Record-ID\":\"<urn:uuid:44ada855-6e1c-4253-9a07-e07012697eea>\",\"Content-Length\":\"14797\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2375e5ab-a26a-41fd-be7c-eeb85d485b71>\",\"WARC-Concurrent-To\":\"<urn:uuid:ec47ad40-61a5-4a9b-accd-a73080adee1b>\",\"WARC-IP-Address\":\"173.194.206.82\",\"WARC-Target-URI\":\"https://android.googlesource.com/toolchain/go/+/9d23975d89e6cc3df4f2156b2ae0df5d2cef16fb/test/makemap.go\",\"WARC-Payload-Digest\":\"sha1:4R7J22YUAL4IVH2Z7UBWSZANPIUHDWMF\",\"WARC-Block-Digest\":\"sha1:UEP55W5QQPVWAM5JTOTZVOK3PAIHFT6R\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-26/CC-MAIN-2019-26_segments_1560627998298.91_warc_CC-MAIN-20190616202813-20190616224813-00534.warc.gz\"}"}