Skip to content

Commit

Permalink
[Docs] Generated documentation for Integration
Browse files Browse the repository at this point in the history
Signed-off-by: l5io <[email protected]>
  • Loading branch information
MUzairS15 authored and l5io committed Oct 15, 2024
1 parent e564a52 commit 9133e14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
3 changes: 1 addition & 2 deletions mesheryctl/internal/cli/root/design/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ func TestDesignList(t *testing.T) {
utils.StopMockery(t)
}


func trimLastNLines(s string, n int) string {
lines := strings.Split(s, "\n")
if len(lines) <= n {
return ""
}
return strings.Join(lines[:len(lines)-n], "\n")
}
}
29 changes: 16 additions & 13 deletions mesheryctl/pkg/utils/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,29 +294,32 @@ func CleanStringFromHandlePagination(data string) string {
// removeANSICodes removes ANSI escape codes from a string.
//
// Parameters:
// text - The input string that may contain ANSI escape sequences.
//
// text - The input string that may contain ANSI escape sequences.
//
// Returns:
// A string with the ANSI escape codes removed.
//
// A string with the ANSI escape codes removed.
func stripAnsiEscapeCodes(text string) string {
ansi := regexp.MustCompile(`\x1b\[[0-9;]*[a-zA-Z]`)
return ansi.ReplaceAllString(text, "")
ansi := regexp.MustCompile(`\x1b\[[0-9;]*[a-zA-Z]`)
return ansi.ReplaceAllString(text, "")
}


// formatToTabs replaces multiple spaces with tabs and trims spaces
//
// Parameters:
// s - The input string containing columns separated by multiple spaces.
//
// s - The input string containing columns separated by multiple spaces.
//
// Returns:
// A string where multiple spaces are replaced with a single tab between columns, and leading/trailing spaces are removed.
//
// A string where multiple spaces are replaced with a single tab between columns, and leading/trailing spaces are removed.
func formatToTabs(data string) string {
s := strings.TrimSpace(data)
s := strings.TrimSpace(data)

// Replace multiple spaces with a single tab
re := regexp.MustCompile(`\s{2,}`) // Match 2 or more spaces
s = re.ReplaceAllString(s, "\t")
// Replace multiple spaces with a single tab
re := regexp.MustCompile(`\s{2,}`) // Match 2 or more spaces
s = re.ReplaceAllString(s, "\t")

return s
}
return s
}

0 comments on commit 9133e14

Please sign in to comment.