From 82b79bfd1d2aade10ef811fc708fa11193c9a3a5 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 05 Apr 2025 23:33:50 +0800 Subject: [PATCH] ansiec: Use const, not var --- internal/ansiec/colors.go | 4 ++-- internal/ansiec/reset.go | 2 +- internal/ansiec/style.go | 2 +- diff --git a/internal/ansiec/colors.go b/internal/ansiec/colors.go index 2068e905da757c7c6267fe2ffb797bc706aec7a6..8e5f54b5b5024c1b92f49259e7bbb6462eda27f8 100644 --- a/internal/ansiec/colors.go +++ b/internal/ansiec/colors.go @@ -3,7 +3,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu package ansiec -var ( +const ( Black = "\x1b[30m" Red = "\x1b[31m" Green = "\x1b[32m" @@ -14,7 +14,7 @@ Cyan = "\x1b[36m" White = "\x1b[37m" ) -var ( +const ( BrightBlack = "\x1b[30;1m" BrightRed = "\x1b[31;1m" BrightGreen = "\x1b[32;1m" diff --git a/internal/ansiec/reset.go b/internal/ansiec/reset.go index 98373962a5f24fed06580b0ae8417b113a2aa3f9..c5b6ba6f4083e15f28eae14e1ad8ec127f04b8a5 100644 --- a/internal/ansiec/reset.go +++ b/internal/ansiec/reset.go @@ -3,4 +3,4 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu package ansiec -var Reset = "\x1b[0m" +const Reset = "\x1b[0m" diff --git a/internal/ansiec/style.go b/internal/ansiec/style.go index bcd0154e169d24462917956fe440f168a8893905..dd373441c2dabcfc6a4ff01567d4d45a744c033a 100644 --- a/internal/ansiec/style.go +++ b/internal/ansiec/style.go @@ -3,7 +3,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu package ansiec -var ( +const ( Bold = "\x1b[1m" Underline = "\x1b[4m" Reversed = "\x1b[7m" -- 2.48.1