Browse Source

Fixed poor English

main
Unbewohnte 3 years ago
parent
commit
ab0e2cc6fa
  1. 10
      id3v10.go
  2. 12
      id3v11.go
  3. 2
      util.go

10
id3v10.go

@ -102,31 +102,31 @@ func WriteID3v1Tags(dst io.WriteSeeker, tags ID3v1Tags) error {
}
// Song name
err = writeToExtend(dst, []byte(tags.SongName), 30)
err = writeToExtent(dst, []byte(tags.SongName), 30)
if err != nil {
return err
}
// Artist
err = writeToExtend(dst, []byte(tags.Artist), 30)
err = writeToExtent(dst, []byte(tags.Artist), 30)
if err != nil {
return err
}
// Album
err = writeToExtend(dst, []byte(tags.Album), 30)
err = writeToExtent(dst, []byte(tags.Album), 30)
if err != nil {
return err
}
// Year
err = writeToExtend(dst, []byte(fmt.Sprint(tags.Year)), 4)
err = writeToExtent(dst, []byte(fmt.Sprint(tags.Year)), 4)
if err != nil {
return err
}
// Comment
err = writeToExtend(dst, []byte(tags.Comment), 30)
err = writeToExtent(dst, []byte(tags.Comment), 30)
if err != nil {
return err
}

12
id3v11.go

@ -116,31 +116,31 @@ func WriteID3v11Tags(dst io.WriteSeeker, tags ID3v11Tags) error {
}
// Song name
err = writeToExtend(dst, []byte(tags.SongName), 30)
err = writeToExtent(dst, []byte(tags.SongName), 30)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}
// Artist
err = writeToExtend(dst, []byte(tags.Artist), 30)
err = writeToExtent(dst, []byte(tags.Artist), 30)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}
// Album
err = writeToExtend(dst, []byte(tags.Album), 30)
err = writeToExtent(dst, []byte(tags.Album), 30)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}
// Year
err = writeToExtend(dst, []byte(fmt.Sprint(tags.Year)), 4)
err = writeToExtent(dst, []byte(fmt.Sprint(tags.Year)), 4)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}
// Comment
err = writeToExtend(dst, []byte(tags.Comment), 28)
err = writeToExtent(dst, []byte(tags.Comment), 28)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}
@ -168,7 +168,7 @@ func WriteID3v11Tags(dst io.WriteSeeker, tags ID3v11Tags) error {
genrebyte := make([]byte, 1)
binary.PutVarint(genrebyte, int64(genreCode))
err = writeToExtend(dst, genrebyte, 1)
err = writeToExtent(dst, genrebyte, 1)
if err != nil {
return fmt.Errorf("could not write to dst: %s", err)
}

2
util.go

@ -38,7 +38,7 @@ func readToString(rs io.Reader, n int) (string, error) {
}
// Writes data to wr, if len(data) is less than lenNeeded - adds null bytes until written lenNeeded bytes
func writeToExtend(wr io.Writer, data []byte, lenNeeded int) error {
func writeToExtent(wr io.Writer, data []byte, lenNeeded int) error {
if len(data) > lenNeeded {
return fmt.Errorf("length of given data bytes is bigger than length needed")
}

Loading…
Cancel
Save