Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for Err (0.17 sec)

  1. src/bytes/buffer_test.go

    	// after successful read
    	if _, err := b.ReadBytes('m'); err != nil {
    		t.Fatalf("ReadBytes: %v", err)
    	}
    	if err := b.UnreadByte(); err != nil {
    		t.Fatalf("UnreadByte: %v", err)
    	}
    	c, err := b.ReadByte()
    	if err != nil {
    		t.Fatalf("ReadByte: %v", err)
    	}
    	if c != 'm' {
    		t.Errorf("ReadByte = %q; want %q", c, 'm')
    	}
    }
    
    // Tests that we occasionally compact. Issue 5154.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. src/archive/zip/reader_test.go

    //			log.Fatal(err)
    //		}
    //	}
    //
    //	func makeZip(name string, r io.Reader) []byte {
    //		var buf bytes.Buffer
    //		w := zip.NewWriter(&buf)
    //		wf, err := w.Create(name)
    //		if err != nil {
    //			log.Fatal(err)
    //		}
    //		if _, err = io.Copy(wf, r); err != nil {
    //			log.Fatal(err)
    //		}
    //		if err := w.Close(); err != nil {
    //			log.Fatal(err)
    //		}
    //		return buf.Bytes()
    //	}
    //
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  3. src/cmd/cgo/doc.go

    assignment context to retrieve both the return value (if any) and the
    C errno variable as an error (use _ to skip the result value if the
    function returns void). For example:
    
    	n, err = C.sqrt(-1)
    	_, err := C.voidFunc()
    	var n, err = C.sqrt(1)
    
    Calling C function pointers is currently not supported, however you can
    declare Go variables which hold C function pointers and pass them
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Sun Mar 31 09:02:45 GMT 2024
    - 42.1K bytes
    - Viewed (0)
  4. doc/go1.17_spec.html

    with the same name as a result parameter is in
    <a href="#Declarations_and_scope">scope</a> at the place of the return.
    </p>
    
    <pre>
    func f(n int) (res int, err error) {
    	if _, err := f(n-1); err != nil {
    		return  // invalid return statement: err is shadowed
    	}
    	return
    }
    </pre>
    
    <h3 id="Break_statements">Break statements</h3>
    
    <p>
    A "break" statement terminates execution of the innermost
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  5. src/archive/tar/common.go

    			}
    		}
    	}
    	var doNameLookups = true
    	if iface, ok := fi.(FileInfoNames); ok {
    		doNameLookups = false
    		var err error
    		h.Gname, err = iface.Gname()
    		if err != nil {
    			return nil, err
    		}
    		h.Uname, err = iface.Uname()
    		if err != nil {
    			return nil, err
    		}
    	}
    	if sysStat != nil {
    		return h, sysStat(fi, h, doNameLookups)
    	}
    	return h, nil
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
  6. src/archive/zip/zip_test.go

    		_, err := f.Write(chunk[:frag])
    		if err != nil {
    			t.Fatal("write chunk:", err)
    		}
    	}
    	end := []byte("END\n")
    	_, err = f.Write(end)
    	if err != nil {
    		t.Fatal("write end:", err)
    	}
    	if err := w.Close(); err != nil {
    		t.Fatal(err)
    	}
    
    	// read back zip file and check that we get to the end of it
    	r, err := NewReader(buf, buf.Size())
    	if err != nil {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  7. src/archive/tar/reader.go

    		if err := discard(tr.r, tr.curr.physicalRemaining()); err != nil {
    			return nil, err
    		}
    		if _, err := tryReadFull(tr.r, tr.blk[:tr.pad]); err != nil {
    			return nil, err
    		}
    		tr.pad = 0
    
    		hdr, rawHdr, err := tr.readHeader()
    		if err != nil {
    			return nil, err
    		}
    		if err := tr.handleRegularFile(hdr); err != nil {
    			return nil, err
    		}
    		format.mayOnlyBe(hdr.Format)
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  8. src/archive/zip/writer.go

    		} else {
    			b.uint32(uint32(h.offset))
    		}
    		if _, err := w.cw.Write(buf[:]); err != nil {
    			return err
    		}
    		if _, err := io.WriteString(w.cw, h.Name); err != nil {
    			return err
    		}
    		if _, err := w.cw.Write(h.Extra); err != nil {
    			return err
    		}
    		if _, err := io.WriteString(w.cw, h.Comment); err != nil {
    			return err
    		}
    	}
    	end := w.cw.count
    
    	records := uint64(len(w.dir))
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 04 14:28:57 GMT 2024
    - 19.3K bytes
    - Viewed (0)
  9. src/archive/tar/tar_test.go

    		Typeflag:   TypeReg,
    	}
    	if err := tw.WriteHeader(hdr); err != nil {
    		t.Fatalf("tw.WriteHeader: %v", err)
    	}
    	if _, err := tw.Write(data); err != nil {
    		t.Fatalf("tw.Write: %v", err)
    	}
    	if err := tw.Close(); err != nil {
    		t.Fatalf("tw.Close: %v", err)
    	}
    
    	// Read it back.
    	tr := NewReader(&b)
    	rHdr, err := tr.Next()
    	if err != nil {
    		t.Fatalf("tr.Next: %v", err)
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  10. src/cmd/api/main_test.go

    func Check(t *testing.T) {
    	checkFiles, err := filepath.Glob(filepath.Join(testenv.GOROOT(t), "api/go1*.txt"))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	var nextFiles []string
    	if v := runtime.Version(); strings.Contains(v, "devel") || strings.Contains(v, "beta") {
    		next, err := filepath.Glob(filepath.Join(testenv.GOROOT(t), "api/next/*.txt"))
    		if err != nil {
    			t.Fatal(err)
    		}
    		nextFiles = next
    	}
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
Back to top