From 7fc76bdb932e6117bc62a5c469b5959f759d0471 Mon Sep 17 00:00:00 2001 From: Sangeeth Sudheer Date: Wed, 1 May 2024 20:16:16 +0530 Subject: [PATCH] Add width placeholder specifier --- formatting/formatting.go | 1 + 1 file changed, 1 insertion(+) diff --git a/formatting/formatting.go b/formatting/formatting.go index ffef30a..72f03e2 100644 --- a/formatting/formatting.go +++ b/formatting/formatting.go @@ -33,4 +33,5 @@ func Formatting() { f("go num width (left align): |%-5d|\n", 2) f("go float precision (left align): |%-5.2f|\n", 3.141516) f("go char: %c\n", 97) + f("go custom width specifier: |%*s|\n", 5, "foo") }