Skip to content

Commit

Permalink
Remove unused code in articlegen
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 27, 2024
1 parent 5e7c3e2 commit b796d54
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tool/articlegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -58,14 +57,6 @@ func main() {
fmt.Printf("%s\n", w.String())
}

func mustReadAll(r io.Reader) []byte {
buf, err := ioutil.ReadAll(r)
if err != nil {
panic(err)
}
return buf
}

func extractTitleFromBody(body string) string {
scanner := bufio.NewScanner(strings.NewReader(body))
if scanner.Scan() {
Expand Down Expand Up @@ -133,13 +124,3 @@ categories: [{{.Categories}}]

return t.Execute(w, data)
}

var annotations = []string{"[draft]", "[deleted]"}

func trimAnnotations(s string) string {
ret := s
for _, a := range annotations {
ret = strings.ReplaceAll(s, a, "")
}
return ret
}

0 comments on commit b796d54

Please sign in to comment.