Skip to content

Commit

Permalink
Improve and add some doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leotaku committed Aug 7, 2024
1 parent b5b3924 commit 779c85d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pdb/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Database struct {
Records []Record
}

// NewDatabase creates an empty Palm database with name.
// NewDatabase creates an empty Palm database with name and date.
func NewDatabase(name string, date time.Time) Database {
return Database{
Name: trimZeroes(name),
Expand Down Expand Up @@ -102,6 +102,9 @@ func (d Database) Write(w io.Writer) error {
}

// ReadDatabase reads an uninterpreted Palm database from r.
//
// This is not a lossless routine, in particular a large portion of
// metadata stored in the Palm database header will be ignored.
func ReadDatabase(r io.Reader) (*Database, error) {
data, err := io.ReadAll(r)
b := bytes.NewReader(data)
Expand Down
1 change: 1 addition & 0 deletions records/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
t "github.com/leotaku/mobi/types"
)

// To32 converts an integer to a content identifier string.
func To32(i int) string {
s := strconv.FormatInt(int64(i), 32)
return fmt.Sprintf("%04v", strings.ToUpper(s))
Expand Down

0 comments on commit 779c85d

Please sign in to comment.