Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(580)

Side by Side Diff: src/pkg/net/file_test.go

Issue 5294074: code review 5294074: src/pkg/[n-z]*: gofix -r error (Closed)
Patch Set: diff -r b78bb4f2d2a3 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/net/file_plan9.go ('k') | src/pkg/net/file_windows.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package net 5 package net
6 6
7 import ( 7 import (
8 "os" 8 "os"
9 "reflect" 9 "reflect"
10 "runtime" 10 "runtime"
11 "syscall" 11 "syscall"
12 "testing" 12 "testing"
13 ) 13 )
14 14
15 type listenerFile interface { 15 type listenerFile interface {
16 Listener 16 Listener
17 » File() (f *os.File, err os.Error) 17 » File() (f *os.File, err error)
18 } 18 }
19 19
20 type packetConnFile interface { 20 type packetConnFile interface {
21 PacketConn 21 PacketConn
22 » File() (f *os.File, err os.Error) 22 » File() (f *os.File, err error)
23 } 23 }
24 24
25 type connFile interface { 25 type connFile interface {
26 Conn 26 Conn
27 » File() (f *os.File, err os.Error) 27 » File() (f *os.File, err error)
28 } 28 }
29 29
30 func testFileListener(t *testing.T, net, laddr string) { 30 func testFileListener(t *testing.T, net, laddr string) {
31 if net == "tcp" { 31 if net == "tcp" {
32 laddr += ":0" // any available port 32 laddr += ":0" // any available port
33 } 33 }
34 l, err := Listen(net, laddr) 34 l, err := Listen(net, laddr)
35 if err != nil { 35 if err != nil {
36 t.Fatalf("Listen failed: %v", err) 36 t.Fatalf("Listen failed: %v", err)
37 } 37 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 if supportsIPv6 { 129 if supportsIPv6 {
130 testFilePacketConnListen(t, "udp", "[::1]:0") 130 testFilePacketConnListen(t, "udp", "[::1]:0")
131 } 131 }
132 if supportsIPv6 && supportsIPv4map { 132 if supportsIPv6 && supportsIPv4map {
133 testFilePacketConnDial(t, "udp", "[::ffff:127.0.0.1]:12345") 133 testFilePacketConnDial(t, "udp", "[::ffff:127.0.0.1]:12345")
134 } 134 }
135 if syscall.OS == "linux" { 135 if syscall.OS == "linux" {
136 testFilePacketConnListen(t, "unixgram", "@gotest1/net") 136 testFilePacketConnListen(t, "unixgram", "@gotest1/net")
137 } 137 }
138 } 138 }
OLDNEW
« no previous file with comments | « src/pkg/net/file_plan9.go ('k') | src/pkg/net/file_windows.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b