Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix int to str conversion #3

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DTD/DTD.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
//
// Found this reference very usefull: https://xmlwriter.net/xml_guide/attlist_declaration.shtml
//
// This is a simplified implementation
// # This is a simplified implementation
//
// This package offers one struct per DTD blocks
// Each struct will implements the IDTDBlock
// the IDTDBlock is necessary for the parser to populate and process its collection
package DTD

import (
"fmt"
"strings"
)

Expand Down Expand Up @@ -96,7 +97,7 @@ func Translate(i int) string {
case NOTATION:
return "Notation"
default:
panic("Unknown type" + string(i) + " requested")
panic("Unknown type" + fmt.Sprintf("%d", i) + " requested")
}
}

Expand Down
3 changes: 2 additions & 1 deletion scanner/sentence.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scanner

import (
"fmt"
"strings"

"github.com/blefort/DTDParser/DTD"
Expand Down Expand Up @@ -39,7 +40,7 @@ func newsentence(start string, end string, Log *zap.SugaredLogger) *sentence {
func (se *sentence) MarshalLogObject(enc zapcore.ObjectEncoder) error {

for i, w := range se.words {
enc.AddString("Word "+string(i), w.Read())
enc.AddString(fmt.Sprintf("Word %d", i), w.Read())
}
return nil
}
Expand Down