File: main.go

package info (click to toggle)
golang-github-pterm-pterm 0.12.79-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,640 kB
  • sloc: makefile: 4
file content (22 lines) | stat: -rw-r--r-- 526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

import "github.com/pterm/pterm"

func main() {
	// Loop from 0 to 14
	for i := 0; i < 15; i++ {
		switch i {
		case 5:
			// At the 5th iteration, print a message and disable the output
			pterm.Info.Println("Disabled Output!")
			pterm.DisableOutput()
		case 10:
			// At the 10th iteration, enable the output and print a message
			pterm.EnableOutput()
			pterm.Info.Println("Enabled Output!")
		}

		// Print a progress message for each iteration
		pterm.Printf("Printing something... [%d/%d]\n", i, 15)
	}
}