Compare commits
1 Commits
v0.2.1
..
d754abe5ac
| Author | SHA1 | Date | |
|---|---|---|---|
| d754abe5ac |
+1
-17
@@ -45,14 +45,6 @@ func writeFieldsTo(w io.Writer, fields []Field, nl string) (int64, error) {
|
|||||||
return int64(written), nil
|
return int64(written), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// String generates a string output for "%s"
|
|
||||||
func (field Field) String() string {
|
|
||||||
var buf bytes.Buffer
|
|
||||||
|
|
||||||
_, _ = writeFieldsTo(&buf, []Field{field}, WriteNewLine)
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func writeSectionToBuffer(w *bytes.Buffer, sec *Section, nl string) int {
|
func writeSectionToBuffer(w *bytes.Buffer, sec *Section, nl string) int {
|
||||||
var written, n int
|
var written, n int
|
||||||
|
|
||||||
@@ -82,14 +74,6 @@ func writeSectionToBuffer(w *bytes.Buffer, sec *Section, nl string) int {
|
|||||||
return written + int(n64)
|
return written + int(n64)
|
||||||
}
|
}
|
||||||
|
|
||||||
// String generates a string output for "%s"
|
|
||||||
func (sec *Section) String() string {
|
|
||||||
var buf bytes.Buffer
|
|
||||||
|
|
||||||
_ = writeSectionToBuffer(&buf, sec, WriteNewLine)
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteTo writes a INI representation of the document
|
// WriteTo writes a INI representation of the document
|
||||||
// onto the provided writer.
|
// onto the provided writer.
|
||||||
func (doc *Document) WriteTo(w io.Writer) (int64, error) {
|
func (doc *Document) WriteTo(w io.Writer) (int64, error) {
|
||||||
@@ -97,7 +81,7 @@ func (doc *Document) WriteTo(w io.Writer) (int64, error) {
|
|||||||
return buf.WriteTo(w)
|
return buf.WriteTo(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
// String generates a string output for "%s"
|
// GoString generates a string output for "%s"
|
||||||
func (doc *Document) String() string {
|
func (doc *Document) String() string {
|
||||||
buf := doc.AsBuffer(WriteNewLine)
|
buf := doc.AsBuffer(WriteNewLine)
|
||||||
return buf.String()
|
return buf.String()
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ module asciigoat.org/ini
|
|||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
|
replace asciigoat.org/core => ../core
|
||||||
|
|
||||||
require (
|
require (
|
||||||
asciigoat.org/core v0.3.7
|
asciigoat.org/core v0.3.7
|
||||||
github.com/mgechev/revive v1.3.3
|
github.com/mgechev/revive v1.3.3
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
asciigoat.org/core v0.3.7 h1:tMasdvZgsMJJMVsZVfXXB5lqq82pFiCsyEmOEmcmAfI=
|
|
||||||
asciigoat.org/core v0.3.7/go.mod h1:tXj+JUutxRbcO40ZQRuUVaZ4rnYz1kAZ0nblisV8u74=
|
|
||||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab h1:5JxePczlyGAtj6R1MUEFZ/UFud6FfsOejq7xLC2ZIb0=
|
github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab h1:5JxePczlyGAtj6R1MUEFZ/UFud6FfsOejq7xLC2ZIb0=
|
||||||
|
|||||||
Reference in New Issue
Block a user