I want to print a star pattern in GO .The desired output is as belows :
I wrote the program to print it but I could write it to print the output aliged on the leftmost side.
The code is :
package main
import "fmt"
func main() {
for i := 1; i <= 6; i++ {
if i == 1 {
fmt.Printfln("#")
fmt.Println()
}
if i == 2 {
fmt.Println( "##")
fmt.Println()
}
if i == 3 {
fmt.Println("###")
fmt.Println()
}
if i == 4 {
fmt.Println("####")
fmt.Println()
}
if i == 5 {
fmt.Println("#####")
fmt.Println()
}
if i == 6 {
fmt.Println("######")
fmt.Println()
}
}
//Enter your code here. Read input from STDIN. Print output to STDOUT
}
How can I achieve the desired format in GO ?