Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for CheckValid (0.2 sec)

  1. src/internal/profile/profile.go

    	zw := gzip.NewWriter(w)
    	defer zw.Close()
    	_, err := zw.Write(b)
    	return err
    }
    
    // CheckValid tests whether the profile is valid. Checks include, but are
    // not limited to:
    //   - len(Profile.Sample[n].value) == len(Profile.value_unit)
    //   - Sample.id has a corresponding Profile.Location
    func (p *Profile) CheckValid() error {
    	// Check that sample values are consistent
    	sampleLen := len(p.SampleType)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 17:57:40 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  2. src/os/file_plan9.go

    func (f *File) setWriteDeadline(time.Time) error {
    	if err := f.checkValid("SetWriteDeadline"); err != nil {
    		return err
    	}
    	return poll.ErrNoDeadline
    }
    
    // checkValid checks whether f is valid for use, but does not prepare
    // to actually use it. If f is not ready checkValid returns an appropriate
    // error, perhaps incorporating the operation name op.
    func (f *File) checkValid(op string) error {
    	if f == nil {
    		return ErrInvalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:35:30 UTC 2024
    - 16K bytes
    - Viewed (0)
  3. src/encoding/json/scanner.go

    // scan is passed in for use by checkValid to avoid an allocation.
    // checkValid returns nil or a SyntaxError.
    func checkValid(data []byte, scan *scanner) error {
    	scan.reset()
    	for _, c := range data {
    		scan.bytes++
    		if scan.step(scan, c) == scanError {
    			return scan.err
    		}
    	}
    	if scan.eof() == scanError {
    		return scan.err
    	}
    	return nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  4. src/os/file.go

    // It returns the number of bytes read and any error encountered.
    // At end of file, Read returns 0, io.EOF.
    func (f *File) Read(b []byte) (n int, err error) {
    	if err := f.checkValid("read"); err != nil {
    		return 0, err
    	}
    	n, e := f.read(b)
    	return n, f.wrapErr("read", e)
    }
    
    // ReadAt reads len(b) bytes from the File starting at byte offset off.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:37 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  5. src/cmd/vendor/github.com/google/pprof/profile/profile.go

    	_, err := w.Write(serialize(p))
    	return err
    }
    
    // CheckValid tests whether the profile is valid. Checks include, but are
    // not limited to:
    //   - len(Profile.Sample[n].value) == len(Profile.value_unit)
    //   - Sample.id has a corresponding Profile.Location
    func (p *Profile) CheckValid() error {
    	// Check that sample values are consistent
    	sampleLen := len(p.SampleType)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 19:48:28 UTC 2024
    - 22.3K bytes
    - Viewed (0)
  6. src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go

    			if err = p.Write(tempFile); err == nil {
    				o.UI.PrintErr("Saved profile in ", tempFile.Name())
    			}
    		}
    		if err != nil {
    			o.UI.PrintErr("Could not save profile: ", err)
    		}
    	}
    
    	if err := p.CheckValid(); err != nil {
    		return nil, err
    	}
    
    	return p, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 19:48:28 UTC 2024
    - 19K bytes
    - Viewed (0)
  7. src/encoding/json/decode.go

    // character U+FFFD.
    func Unmarshal(data []byte, v any) error {
    	// Check for well-formedness.
    	// Avoids filling out half a data structure
    	// before discovering a JSON syntax error.
    	var d decodeState
    	err := checkValid(data, &d.scan)
    	if err != nil {
    		return err
    	}
    
    	d.init(data)
    	return d.unmarshal(v)
    }
    
    // Unmarshaler is the interface implemented by types
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  8. src/runtime/metrics_test.go

    		var w bytes.Buffer
    		pprof.Lookup("mutex").WriteTo(&w, 0)
    		p, err := profile.Parse(&w)
    		if err != nil {
    			t.Fatalf("failed to parse profile: %v", err)
    		}
    		if err := p.CheckValid(); err != nil {
    			t.Fatalf("invalid profile: %v", err)
    		}
    		return p
    	}
    
    	measureDelta := func(t *testing.T, fn func()) (metricGrowth, profileGrowth float64, p *profile.Profile) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
Back to top