chore: apply gofmt formatting

This commit is contained in:
Houmgaor
2026-02-06 13:02:38 +01:00
parent 09f829f8be
commit 4960c5cb5d
16 changed files with 159 additions and 148 deletions

View File

@@ -9,6 +9,7 @@
// Packet Structure:
//
// MHF packets follow this wire format:
//
// [2 bytes: Opcode][N bytes: Packet-specific data][2 bytes: Footer 0x00 0x10]
//
// Each packet type defines its own structure matching the binary format expected

View File

@@ -311,4 +311,3 @@ func TestEmptyHandlers_NoDb(t *testing.T) {
})
}
}

View File

@@ -61,6 +61,7 @@ type ConnectionStats struct {
// - v: Verbose output including objects and stage changes
//
// Examples:
//
// runConnections([]string{"-stats"})
// runConnections([]string{"-sessions", "-v"})
// runConnections([]string{"-player", "Sarah", "-sessions"})

View File

@@ -44,6 +44,7 @@ type ErrorGroup struct {
// - detailed: Show detailed information including examples and extra data
//
// Examples:
//
// runErrors([]string{"-summary"})
// runErrors([]string{"-detailed", "-stack"})
// runErrors([]string{"-group", "caller", "-limit", "20"})

View File

@@ -23,6 +23,7 @@ import (
// All filters are combined with AND logic.
//
// Examples:
//
// runFilter([]string{"-level", "error"})
// runFilter([]string{"-since", "1h", "-logger", "channel-4*"})
// runFilter([]string{"-msg", "connection reset", "-count"})
@@ -137,6 +138,7 @@ func runFilter(args []string) {
// - true if the string matches the pattern, false otherwise
//
// Examples:
//
// matchWildcard("channel-4", "channel-*") // returns true
// matchWildcard("main.channel-4.error", "*channel-4*") // returns true
// matchWildcard("test", "foo*") // returns false

View File

@@ -16,6 +16,7 @@ import (
// - tail: Follow logs in real-time (like tail -f)
//
// Usage:
//
// loganalyzer <command> [options]
// loganalyzer filter -level error -since 1h
// loganalyzer errors -summary

View File

@@ -50,6 +50,7 @@ type LogEntry struct {
// - An error if the file cannot be opened or read
//
// Example:
//
// entries, err := ParseLogFile("erupe.log")
// if err != nil {
// log.Fatal(err)
@@ -106,6 +107,7 @@ func ParseLogFile(filename string) ([]*LogEntry, error) {
// - A LogEntry pointer containing the parsed data, or nil if the line is invalid
//
// Example:
//
// entry := ParseLogLine(`{"level":"info","ts":1762989571.547817,"msg":"Starting"}`)
// fmt.Println(entry.Level, entry.Message)
func ParseLogLine(line string) *LogEntry {
@@ -201,6 +203,7 @@ func ParseLogLine(line string) *LogEntry {
// - An error if the file cannot be opened, read, or if the callback returns an error
//
// Example:
//
// err := StreamLogFile("erupe.log", func(entry *LogEntry) error {
// if entry.Level == "error" {
// fmt.Println(entry.Message)
@@ -259,6 +262,7 @@ func StreamLogFile(filename string, callback func(*LogEntry) error) error {
// - A formatted string representation of the log entry
//
// Example:
//
// formatted := FormatLogEntry(entry, true)
// fmt.Println(formatted)
// // Output: 2025-11-12 23:19:31.546 INFO [main] Starting Erupe

View File

@@ -49,6 +49,7 @@ type LogStats struct {
// - detailed: Show detailed statistics including temporal patterns and top messages
//
// Examples:
//
// runStats([]string{}) // Basic statistics
// runStats([]string{"-detailed"}) // Full statistics with temporal analysis
// runStats([]string{"-detailed", "-top", "20"}) // Show top 20 items

View File

@@ -30,6 +30,7 @@ import (
// The follow mode polls the file every 100ms for new content. Use Ctrl+C to stop.
//
// Examples:
//
// runTail([]string{}) // Show last 10 lines and follow
// runTail([]string{"-n", "50"}) // Show last 50 lines and follow
// runTail([]string{"-level", "error"}) // Only show errors