1+ // Package fluxo_de_controle provides functions and utilities to demonstrate
2+ // and explain control flow concepts in Go. It includes examples and explanations
3+ // for various control flow structures such as loops, conditionals, and logical operators.
14package fluxo_de_controle
25
36import (
@@ -6,8 +9,14 @@ import (
69 "github.com/fabianoflorentino/aprendago/pkg/format"
710)
811
9- const rootDir = "internal/fluxo_de_controle"
12+ // rootDir represents the root directory path for the "fluxo_de_controle" module within the internal package.
13+ const (
14+ rootDir = "internal/fluxo_de_controle"
15+ )
1016
17+ // FluxoDeControle demonstrates various control flow constructs in Go.
18+ // It prints section headers and executes corresponding sections to illustrate
19+ // different control flow mechanisms such as loops, conditionals, and logical operators.
1120func FluxoDeControle () {
1221 fmt .Printf ("\n \n 06 - Fluxo de Controle\n " )
1322
@@ -24,6 +33,9 @@ func FluxoDeControle() {
2433 executeSection ("Operadores lógicos condicionais" )
2534}
2635
36+ // MenuFluxoDeControle returns a slice of format.MenuOptions, each representing a menu option
37+ // for different sections of control flow topics in Go. Each menu option has an associated
38+ // execution function that calls executeSection with a specific section title.
2739func MenuFluxoDeControle ([]string ) []format.MenuOptions {
2840 return []format.MenuOptions {
2941 {Options : "--entendendo-fluxo-de-controle" , ExecFunc : func () { executeSection ("Entendendo Fluxo de Controle" ) }},
@@ -40,6 +52,10 @@ func MenuFluxoDeControle([]string) []format.MenuOptions {
4052 }
4153}
4254
55+ // HelpMeFluxoDeControle provides a list of help topics related to control flow in Go.
56+ // It includes explanations and details about various control flow concepts such as loops,
57+ // conditional statements, and logical operators. The function prints a formatted help
58+ // message to guide users through these topics.
4359func HelpMeFluxoDeControle () {
4460 hlp := []format.HelpMe {
4561 {Flag : "--entendendo-fluxo-de-controle" , Description : "Explica o conceito de fluxo de controle em Go." , Width : 0 },
@@ -60,6 +76,9 @@ func HelpMeFluxoDeControle() {
6076 format .PrintHelpMe (hlp )
6177}
6278
79+ // executeSection formats and processes a given section of the project.
80+ // It takes a section name as a string and applies the FormatSection function
81+ // from the format package to the specified section within the root directory.
6382func executeSection (section string ) {
6483 format .FormatSection (rootDir , section )
6584}
0 commit comments