Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZonda committed Apr 27, 2024
1 parent d646ebd commit d235861
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
.idea
signature-counter
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ func main() {

}

func Split(content string, beginToken string, endToken string) (string, string, string) {
func Split(content string, beginToken string, endToken string) (header string, body string, footer string) {
begins := strings.SplitN(content, beginToken, 2)
token0 := strings.TrimSpace(begins[0])
header = strings.TrimSpace(begins[0])

content = begins[1]

ends := strings.SplitN(content, endToken, 2)
token1 := strings.TrimSpace(ends[0])
token2 := strings.TrimSpace(ends[1])
return token0, token1, token2
body = strings.TrimSpace(ends[0])
footer = strings.TrimSpace(ends[1])
return

}

Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ END`
const TEST_FILE = "test.md"

func TestMainFunc(t *testing.T) {
//defer os.Remove(TEST_FILE)
defer os.Remove(TEST_FILE)
iox.WriteAllText(TEST_FILE, README)
os.Args = []string{"main", TEST_FILE}
main()
Expand Down
10 changes: 0 additions & 10 deletions test.md

This file was deleted.

0 comments on commit d235861

Please sign in to comment.