LEFT | RIGHT |
1 // cmpout | 1 // compile |
| 2 // this file will output a list of filenames in cwd, not suitable for cmpout |
2 | 3 |
3 // Copyright 2011 The Go Authors. All rights reserved. | 4 // Copyright 2011 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 5 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 6 // license that can be found in the LICENSE file. |
6 | 7 |
7 // This file contains examples to embed in the Go 1 release notes document. | 8 // This file contains examples to embed in the Go 1 release notes document. |
8 | 9 |
9 package main | 10 package main |
10 | 11 |
11 import ( | 12 import ( |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 239 } |
239 | 240 |
240 func osIsExist() { | 241 func osIsExist() { |
241 name := "go1.go" | 242 name := "go1.go" |
242 f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) | 243 f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) |
243 if os.IsExist(err) { | 244 if os.IsExist(err) { |
244 log.Printf("%s already exists", name) | 245 log.Printf("%s already exists", name) |
245 } | 246 } |
246 _ = f | 247 _ = f |
247 } | 248 } |
LEFT | RIGHT |