mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-06-26 04:12:57 +00:00
chore: add golangci-lint v2 config and fix linter warnings (#46)
- [x] Add golangci-lint v2 configuration with formatters section - [x] Reorganize linters-settings under linters section - [x] Replace if-else chains with switch statements for clarity - [x] Wrap all ignored error returns with `_ = ` pattern - [x] Add OSC 8 hyperlink helper function for clickable ports - [x] Add blank line in table styling function - [x] Remove unnecessary type assertion in test
This commit is contained in:
@@ -187,6 +187,13 @@ func (t *TableUI) Remove(id string) {
|
||||
delete(t.forwards, id)
|
||||
}
|
||||
|
||||
// hyperlink wraps text in an OSC 8 terminal hyperlink escape sequence.
|
||||
// Clicking the text opens the URL in terminals that support it (Ghostty, iTerm2,
|
||||
// Windows Terminal, Kitty, WezTerm, etc.). Unsupported terminals show plain text.
|
||||
func hyperlink(url, text string) string {
|
||||
return fmt.Sprintf("\x1b]8;;%s\x1b\\%s\x1b]8;;\x1b\\", url, text)
|
||||
}
|
||||
|
||||
// truncate truncates a string to maxLen, adding "..." if needed
|
||||
func truncate(s string, maxLen int) string {
|
||||
if len(s) <= maxLen {
|
||||
|
||||
Reference in New Issue
Block a user