move formatter to ui package

This commit is contained in:
frosty 2024-07-30 04:04:03 -04:00
parent a0d943d710
commit 336111f854
2 changed files with 3 additions and 2 deletions

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
package main package ui
import "fmt" import "fmt"

View file

@ -21,6 +21,7 @@ import (
"log" "log"
"codeberg.org/frosty/sysinfo/lib/readers" "codeberg.org/frosty/sysinfo/lib/readers"
"codeberg.org/frosty/sysinfo/lib/ui"
) )
func main() { func main() {
@ -34,7 +35,7 @@ func main() {
if err != nil { if err != nil {
log.Fatalf("%v\n", err) log.Fatalf("%v\n", err)
} }
fmt.Printf("RAM: %v / %v\n", PrettifySize(memoryInfo.Used, 2), PrettifySize(memoryInfo.Total, 2)) fmt.Printf("RAM: %v / %v\n", ui.PrettifySize(memoryInfo.Used, 2), ui.PrettifySize(memoryInfo.Total, 2))
cpuUsageInfo, err := readers.ReadCpuUsage() cpuUsageInfo, err := readers.ReadCpuUsage()
if err != nil { if err != nil {