Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for ok (0.14 sec)

  1. src/archive/tar/common.go

    			canSplitUSTAR := paxKey == paxPath
    			if _, _, ok := splitUSTARPath(s); !canSplitUSTAR || !ok {
    				whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%q", name, s)
    				format.mustNotBe(FormatUSTAR)
    			}
    			if paxKey == paxNone {
    				whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%q", name, s)
    				format.mustNotBe(FormatPAX)
    			} else {
    				paxHdrs[paxKey] = s
    			}
    		}
    		if v, ok := h.PAXRecords[paxKey]; ok && v == s {
    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)
  2. doc/go1.17_spec.html

    </p>
    
    <pre>
    v, ok = x.(T)
    v, ok := x.(T)
    var v, ok = x.(T)
    var v, ok interface{} = x.(T) // dynamic types of v and ok are T and bool
    </pre>
    
    <p>
    yields an additional untyped boolean value. The value of <code>ok</code> is <code>true</code>
    if the assertion holds. Otherwise it is <code>false</code> and the value of <code>v</code> is
    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)
  3. src/builtin/builtin.go

    // from a closed channel c, any receive from c will succeed without
    // blocking, returning the zero value for the channel element. The form
    //
    //	x, ok := <-c
    //
    // will also set ok to false for a closed and empty channel.
    func close(c chan<- Type)
    
    // The panic built-in function stops normal execution of the current
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. src/archive/zip/zip_test.go

    		t.Errorf("ModifiedTime: got %d, want %d\n", got, want)
    	}
    	if got, want := fh2.ModifiedDate, fh.ModifiedDate; got != want {
    		t.Errorf("ModifiedDate: got %d, want %d\n", got, want)
    	}
    
    	if sysfh, ok := fi.Sys().(*FileHeader); !ok && sysfh != fh {
    		t.Errorf("Sys didn't return original *FileHeader")
    	}
    }
    
    func TestFileHeaderRoundTrip(t *testing.T) {
    	fh := &FileHeader{
    		Name:             "foo.txt",
    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)
  5. src/cmd/api/main_test.go

    					for _, id := range n.Names {
    						mark(id)
    					}
    					if len(n.Names) == 0 {
    						// embedded field T or *T?
    						typ := n.Type
    						if ptr, ok := typ.(*ast.StarExpr); ok {
    							typ = ptr.X
    						}
    						if id, ok := typ.(*ast.Ident); ok {
    							mark(id)
    						}
    					}
    				}
    				return false
    			default:
    				return false
    			}
    		})
    	}
    }
    
    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)
  6. src/archive/tar/stat_unix.go

    	sys, ok := fi.Sys().(*syscall.Stat_t)
    	if !ok {
    		return nil
    	}
    	h.Uid = int(sys.Uid)
    	h.Gid = int(sys.Gid)
    	if doNameLookups {
    		// Best effort at populating Uname and Gname.
    		// The os/user functions may fail for any number of reasons
    		// (not implemented on that platform, cgo not enabled, etc).
    		if u, ok := userMap.Load(h.Uid); ok {
    			h.Uname = u.(string)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  7. doc/go_spec.html

    </p>
    
    <pre>
    v, ok = x.(T)
    v, ok := x.(T)
    var v, ok = x.(T)
    var v, ok interface{} = x.(T) // dynamic types of v and ok are T and bool
    </pre>
    
    <p>
    yields an additional untyped boolean value. The value of <code>ok</code> is <code>true</code>
    if the assertion holds. Otherwise it is <code>false</code> and the value of <code>v</code> is
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu May 02 22:43:51 GMT 2024
    - 279.6K bytes
    - Viewed (0)
  8. src/archive/tar/tar_test.go

    type testFile struct {
    	ops fileOps
    	pos int64
    }
    
    func (f *testFile) Read(b []byte) (int, error) {
    	if len(b) == 0 {
    		return 0, nil
    	}
    	if len(f.ops) == 0 {
    		return 0, io.EOF
    	}
    	s, ok := f.ops[0].(string)
    	if !ok {
    		return 0, errors.New("unexpected Read operation")
    	}
    
    	n := copy(b, s)
    	if len(s) > n {
    		f.ops[0] = s[n:]
    	} else {
    		f.ops = f.ops[1:]
    	}
    	f.pos += int64(len(b))
    	return n, nil
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  9. src/archive/tar/writer_test.go

    	}
    
    	for _, v := range vectors {
    		prefix, suffix, ok := splitUSTARPath(v.input)
    		if prefix != v.prefix || suffix != v.suffix || ok != v.ok {
    			t.Errorf("splitUSTARPath(%q):\ngot  (%q, %q, %v)\nwant (%q, %q, %v)",
    				v.input, prefix, suffix, ok, v.prefix, v.suffix, v.ok)
    		}
    	}
    }
    
    // TestIssue12594 tests that the Writer does not attempt to populate the prefix
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  10. src/archive/tar/reader.go

    	default:
    		return n, nil
    	}
    }
    
    func (sr *sparseFileReader) WriteTo(w io.Writer) (n int64, err error) {
    	ws, ok := w.(io.WriteSeeker)
    	if ok {
    		if _, err := ws.Seek(0, io.SeekCurrent); err != nil {
    			ok = false // Not all io.Seeker can really seek
    		}
    	}
    	if !ok {
    		return io.Copy(w, struct{ io.Reader }{sr})
    	}
    
    	var writeLastByte bool
    	pos0 := sr.pos
    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)
Back to top