Skip to content

Commit

Permalink
Update action.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Mar 16, 2023
1 parent ba22ce2 commit 5de73b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/types/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (a *Action) GetData() error {

// WriteDocumentation write the table to the output file
func (a *Action) WriteDocumentation(inputTable, outputTable *strings.Builder) error {
var error error
input, err := os.ReadFile(a.OutputFileName)

if err != nil {
Expand Down Expand Up @@ -107,13 +108,11 @@ func (a *Action) WriteDocumentation(inputTable, outputTable *strings.Builder) er
if hasOutputsData {
output = utils.ReplaceBytesInBetween(output, outputStartIndex, outputEndIndex, []byte(outputsStr))
} else {
re, _ := regexp.Compile(fmt.Sprintf("(?m)^%s", internal.OutputsHeader))
re, err := regexp.Compile(fmt.Sprintf("(?m)^%s", internal.OutputsHeader))
if err != nil {
return err
}
output = re.ReplaceAll([]byte(output), []byte(outputsStr))

//output = bytes.Replace(output, []byte(internal.OutputsHeader), []byte(outputsStr), -1)
}

if len(output) > 0 {
Expand Down

0 comments on commit 5de73b8

Please sign in to comment.