~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/gofix/testdata/reflect.export.go.out

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
func checkChan(chT interface{}, dir Dir) (reflect.Value, os.Error) {
344
344
        chanType := reflect.TypeOf(chT)
345
345
        if chanType.Kind() != reflect.Chan {
346
 
                return reflect.Value{}, os.ErrorString("not a channel")
 
346
                return reflect.Value{}, os.NewError("not a channel")
347
347
        }
348
348
        if dir != Send && dir != Recv {
349
 
                return reflect.Value{}, os.ErrorString("unknown channel direction")
 
349
                return reflect.Value{}, os.NewError("unknown channel direction")
350
350
        }
351
351
        switch chanType.ChanDir() {
352
352
        case reflect.BothDir:
353
353
        case reflect.SendDir:
354
354
                if dir != Recv {
355
 
                        return reflect.Value{}, os.ErrorString("to import/export with Send, must provide <-chan")
 
355
                        return reflect.Value{}, os.NewError("to import/export with Send, must provide <-chan")
356
356
                }
357
357
        case reflect.RecvDir:
358
358
                if dir != Send {
359
 
                        return reflect.Value{}, os.ErrorString("to import/export with Recv, must provide chan<-")
 
359
                        return reflect.Value{}, os.NewError("to import/export with Recv, must provide chan<-")
360
360
                }
361
361
        }
362
362
        return reflect.ValueOf(chT), nil
376
376
        defer exp.mu.Unlock()
377
377
        _, present := exp.names[name]
378
378
        if present {
379
 
                return os.ErrorString("channel name already being exported:" + name)
 
379
                return os.NewError("channel name already being exported:" + name)
380
380
        }
381
381
        exp.names[name] = &chanDir{ch, dir}
382
382
        return nil
393
393
        // TODO drop all instances of channel from client sets
394
394
        exp.mu.Unlock()
395
395
        if !ok {
396
 
                return os.ErrorString("netchan export: hangup: no such channel: " + name)
 
396
                return os.NewError("netchan export: hangup: no such channel: " + name)
397
397
        }
398
398
        chDir.ch.Close()
399
399
        return nil