mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 04:46:40 +00:00
Ensure all exported functions and types have descriptive comments
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"sort"
|
||||
)
|
||||
|
||||
// NewDump returns a *Dump instance populated with the specified file path.
|
||||
func NewDump(filePath string) *Dump {
|
||||
return &Dump{FilePath: filePath}
|
||||
}
|
||||
@@ -54,6 +55,8 @@ func (s *Dump) Process() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// PrintEntryAddress prints the memory addresses in hex (0x...) format of the
|
||||
// entries for the list of given indexes.
|
||||
func (s *Dump) PrintEntryAddress(indexes []*string) {
|
||||
for _, index := range indexes {
|
||||
if entry, ok := s.Entries[*index]; ok {
|
||||
@@ -62,6 +65,9 @@ func (s *Dump) PrintEntryAddress(indexes []*string) {
|
||||
}
|
||||
}
|
||||
|
||||
// PrintEntryJSON prints the full JSON blob from the input file for the entries
|
||||
// with the given indexes. It does this by using the Offset value of the entries
|
||||
// to avoid having to load up the whole dump file in memory.
|
||||
func (s *Dump) PrintEntryJSON(indexes []*string) error {
|
||||
file, err := os.Open(s.FilePath)
|
||||
defer file.Close()
|
||||
|
||||
Reference in New Issue
Block a user