Skip to content

Commit efd0c86

Browse files
Merge pull request #64 from fabianoflorentino/development
Development to Main
2 parents 6624778 + 3b5ffa2 commit efd0c86

File tree

10 files changed

+218
-88
lines changed

10 files changed

+218
-88
lines changed

README.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ Capítulos do Curso
131131
--cap=22 --topics Exercícios Ninja: Nível 10
132132
--cap=23 --topics Tratamento de Erro
133133
--cap=24 --topics Exercícios Ninja: Nível 11
134+
--cap=25 --topics Documentação
135+
--cap=26 --topics Exercícios Ninja: Nível 12
136+
--cap=27 --topics Teste e Benchmarking
134137

135138
Outline do Curso por Capítulo
136139

@@ -157,6 +160,10 @@ Outline do Curso por Capítulo
157160
--cap=21 --overview Canais
158161
--cap=22 --overview Exercícios Ninja Nível 10
159162
--cap=23 --overview Tratamento de Erro
163+
--cap=24 --overview Exercícios Ninja Nível 11
164+
--cap=25 --overview Documentação
165+
--cap=26 --overview Exercícios Ninja Nível 12
166+
--cap=27 --overview Teste e Benchmarking
160167

161168
Capítulo 1: Visão Geral do Curso
162169

@@ -485,6 +492,31 @@ Capítulo 24: Exercicios Ninja Nível 11
485492
--na-pratica-exercicio-5 --nivel-11 Apresenta o quinto exercício prático do curso.
486493
--na-pratica-exercicio-5 --nivel-11 --resolucao Exibe a resolução do quinto exercício prático.
487494

495+
Capítulo 25: Documentação
496+
--introducao Introdução
497+
--go-doc go doc
498+
--godoc godoc
499+
--pkg-go-dev https://pkg.go.dev/
500+
--escrevendo-documentacao Escrevendo documentação
501+
502+
Capítulo 26: Exercicios Ninja Nível 12
503+
504+
--na-pratica-exercicio-1 --nivel-12 Apresenta o primeiro exercício prático do curso.
505+
--na-pratica-exercicio-1 --nivel-12 --resolucao Exibe a resolução do primeiro exercício prático.
506+
--na-pratica-exercicio-2 --nivel-12 Apresenta o segundo exercício prático do curso.
507+
--na-pratica-exercicio-2 --nivel-12 --resolucao Exibe a resolução do segundo exercício prático.
508+
--na-pratica-exercicio-3 --nivel-12 Apresenta o terceiro exercício prático do curso.
509+
--na-pratica-exercicio-3 --nivel-12 --resolucao Exibe a resolução do terceiro exercício prático.
510+
511+
Capítulo 27: Teste e Benchmarking
512+
513+
--introducao Introdução
514+
--testes-em-tabelas Testes em tabelas
515+
--testes-como-exemplo Testes como exemplo
516+
--go-fmt-govet-golint go fmt, govet e golint
517+
--benchmark Benchmark
518+
--cobertura Cobertura
519+
488520
```
489521
490522
## Estrutura do Projeto
@@ -524,6 +556,9 @@ Capítulo 24: Exercicios Ninja Nível 11
524556
│   ├── concorrencia
525557
│   │   ├── overview.yml
526558
│   │   └── topics.go
559+
│   ├── documentacao
560+
│   │   ├── overview.yml
561+
│   │   └── topics.go
527562
│   ├── exercicios_ninja_nivel_1
528563
│   │   ├── overview.yml
529564
│   │   ├── resolution_exercises.go
@@ -537,6 +572,10 @@ Capítulo 24: Exercicios Ninja Nível 11
537572
│   │   ├── resolution_exercises.go
538573
│   │   ├── resolution_exercises_test.go
539574
│   │   └── topics.go
575+
│   ├── exercicios_ninja_nivel_12
576+
│   │   ├── overview.yml
577+
│   │   ├── resolution_exercises.go
578+
│   │   └── topics.go
540579
│   ├── exercicios_ninja_nivel_2
541580
│   │   ├── overview.yml
542581
│   │   ├── resolution_exercises.go
@@ -594,6 +633,9 @@ Capítulo 24: Exercicios Ninja Nível 11
594633
│   ├── structs
595634
│   │   ├── overview.yml
596635
│   │   └── topics.go
636+
│   ├── teste_benchmarking
637+
│   │   ├── overview.yml
638+
│   │   └── topics.go
597639
│   ├── tratamento_de_erro
598640
│   │   ├── overview.yml
599641
│   │   └── topics.go
@@ -619,14 +661,10 @@ Capítulo 24: Exercicios Ninja Nível 11
619661
│   └── overview.go
620662
└── tree.log
621663

622-
38 directories, 90 files
664+
41 directories, 97 files
623665

624666
```
625667
626-
## Documentação Técnica
627-
628-
[`pkg/format/questionnaire.go`](docs/questionarie.md)
629-
630668
## Licença
631669
632670
Este projeto é licenciado sob a licença MIT. Consulte o arquivo [LICENSE](LICENSE) para obter detalhes.

docs/questionarie.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

internal/chapter/chapter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/fabianoflorentino/aprendago/internal/ponteiros"
3030
"github.com/fabianoflorentino/aprendago/internal/seu_ambiente_de_desenvolvimento"
3131
"github.com/fabianoflorentino/aprendago/internal/structs"
32+
"github.com/fabianoflorentino/aprendago/internal/teste_benchmarking"
3233
"github.com/fabianoflorentino/aprendago/internal/tratamento_de_erro"
3334
"github.com/fabianoflorentino/aprendago/internal/variaveis_valores_tipos"
3435
"github.com/fabianoflorentino/aprendago/internal/visao_geral_do_curso"
@@ -66,5 +67,6 @@ func New() []func() {
6667
exercicios_ninja_nivel_11.ExerciciosNinjaNivel11,
6768
documentacao.Documentacao,
6869
exercicios_ninja_nivel_12.ExerciciosNinjaNivel12,
70+
teste_benchmarking.TesteEBenchmarking,
6971
}
7072
}

internal/documentacao/topics.go

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Package documentacao provides functionalities to handle documentation topics
2+
// for the "aprendago" project. It includes functions to display documentation
3+
// sections, generate menu options for documentation topics, and print help
4+
// information related to documentation.
15
package documentacao
26

37
import (
@@ -6,10 +10,14 @@ import (
610
"github.com/fabianoflorentino/aprendago/pkg/format"
711
)
812

13+
// rootDir represents the root directory for documentation files within the project.
914
const (
1015
rootDir = "internal/documentacao"
1116
)
1217

18+
// Package documentacao provides functions to execute and display various sections
19+
// related to Go documentation. It includes topics such as introduction to documentation,
20+
// usage of go doc, godoc, and pkg.go.dev, as well as writing documentation.
1321
func Documentacao() {
1422
fmt.Printf("\n\nCapítulo 25: Documentação\n")
1523

@@ -20,16 +28,34 @@ func Documentacao() {
2028
executeSections("Escrevendo documentação")
2129
}
2230

31+
// Package documentacao provides functionalities related to documentation topics in Go.
32+
// It includes a menu with various documentation options and their respective execution functions.
33+
34+
// MenuDocumentacao returns a slice of MenuOptions containing different documentation topics
35+
// and their associated execution functions. Each option is represented by a string and
36+
// an ExecFunc that executes the corresponding section.
2337
func MenuDocumentacao([]string) []format.MenuOptions {
2438
return []format.MenuOptions{
25-
{Options: "--introducao", ExecFunc: func() { executeSections("Introdução") }},
39+
{Options: "--introducao-documentacao", ExecFunc: func() { executeSections("Introdução") }},
2640
{Options: "--go-doc", ExecFunc: func() { executeSections("go doc") }},
2741
{Options: "--godoc", ExecFunc: func() { executeSections("godoc") }},
2842
{Options: "--pkg-go-dev", ExecFunc: func() { executeSections("https://pkg.go.dev/") }},
2943
{Options: "--escrevendo-documentacao", ExecFunc: func() { executeSections("Escrevendo documentação") }},
3044
}
3145
}
3246

47+
// HelpMeDocumentacao provides a list of documentation topics and their descriptions.
48+
// It prints a formatted help message for Chapter 25: Documentation.
49+
//
50+
// The topics include:
51+
// - Introdução: Introduction to the topic
52+
// - go doc: Information about the 'go doc' command
53+
// - godoc: Information about the 'godoc' command
54+
// - https://pkg.go.dev/: Link to the Go package documentation website
55+
// - Escrevendo documentação: Tips on writing documentation
56+
//
57+
// This function is part of the 'documentacao' package, which contains utilities and helpers
58+
// for generating and managing documentation in Go projects.
3359
func HelpMeDocumentacao() {
3460
hlp := []format.HelpMe{
3561
{Flag: "--introducao", Description: "Introdução"},
@@ -43,6 +69,9 @@ func HelpMeDocumentacao() {
4369
format.PrintHelpMe(hlp)
4470
}
4571

72+
// executeSections formats and processes a given section of documentation.
73+
// It takes a section name as a string and uses the FormatSection function
74+
// from the format package to apply formatting to the section within the root directory.
4675
func executeSections(section string) {
4776
format.FormatSection(rootDir, section)
4877
}

internal/menu/capitulo_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/fabianoflorentino/aprendago/internal/ponteiros"
2929
"github.com/fabianoflorentino/aprendago/internal/seu_ambiente_de_desenvolvimento"
3030
"github.com/fabianoflorentino/aprendago/internal/structs"
31+
"github.com/fabianoflorentino/aprendago/internal/teste_benchmarking"
3132
"github.com/fabianoflorentino/aprendago/internal/tratamento_de_erro"
3233
"github.com/fabianoflorentino/aprendago/internal/variaveis_valores_tipos"
3334
"github.com/fabianoflorentino/aprendago/internal/visao_geral_do_curso"
@@ -64,6 +65,7 @@ func MenuCapituloOptions([]string) []format.MenuOptions {
6465
{Options: "--cap=24 --topics", ExecFunc: func() { exercicios_ninja_nivel_11.HelpMeExerciciosNinjaNivel11() }},
6566
{Options: "--cap=25 --topics", ExecFunc: func() { documentacao.HelpMeDocumentacao() }},
6667
{Options: "--cap=26 --topics", ExecFunc: func() { exercicios_ninja_nivel_12.HelpMeExerciciosNinjaNivel12() }},
68+
{Options: "--cap=27 --topics", ExecFunc: func() { teste_benchmarking.HelpMeTesteEBenchmarking() }},
6769
}
6870
}
6971

@@ -100,6 +102,7 @@ func HelpMeCapituloOptions() {
100102
{Flag: "--cap=24 --topics", Description: "Exercícios Ninja: Nível 11"},
101103
{Flag: "--cap=25 --topics", Description: "Documentação"},
102104
{Flag: "--cap=26 --topics", Description: "Exercícios Ninja: Nível 12"},
105+
{Flag: "--cap=27 --topics", Description: "Teste e Benchmarking"},
103106
}
104107

105108
fmt.Println("Capítulos do Curso")

internal/menu/capitulo_outline.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/fabianoflorentino/aprendago/internal/ponteiros"
2929
"github.com/fabianoflorentino/aprendago/internal/seu_ambiente_de_desenvolvimento"
3030
"github.com/fabianoflorentino/aprendago/internal/structs"
31+
"github.com/fabianoflorentino/aprendago/internal/teste_benchmarking"
3132
"github.com/fabianoflorentino/aprendago/internal/tratamento_de_erro"
3233
"github.com/fabianoflorentino/aprendago/internal/variaveis_valores_tipos"
3334
"github.com/fabianoflorentino/aprendago/internal/visao_geral_do_curso"
@@ -66,6 +67,7 @@ func MenuCapituloOutline([]string) []format.MenuOptions {
6667
{Options: "--cap=24 --overview", ExecFunc: func() { exercicios_ninja_nivel_11.ExerciciosNinjaNivel11() }},
6768
{Options: "--cap=25 --overview", ExecFunc: func() { documentacao.Documentacao() }},
6869
{Options: "--cap=26 --overview", ExecFunc: func() { exercicios_ninja_nivel_12.ExerciciosNinjaNivel12() }},
70+
{Options: "--cap=27 --overview", ExecFunc: func() { teste_benchmarking.TesteEBenchmarking() }},
6971
}
7072
}
7173

@@ -100,6 +102,7 @@ func HelpMeCapituloOutline() {
100102
{Flag: "--cap=24 --overview", Description: "Exercícios Ninja Nível 11"},
101103
{Flag: "--cap=25 --overview", Description: "Documentação"},
102104
{Flag: "--cap=26 --overview", Description: "Exercícios Ninja Nível 12"},
105+
{Flag: "--cap=27 --overview", Description: "Teste e Benchmarking"},
103106
}
104107

105108
fmt.Printf("\nOutline do Curso por Capítulo\n")

internal/menu/helpme.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/fabianoflorentino/aprendago/internal/ponteiros"
3030
"github.com/fabianoflorentino/aprendago/internal/seu_ambiente_de_desenvolvimento"
3131
"github.com/fabianoflorentino/aprendago/internal/structs"
32+
"github.com/fabianoflorentino/aprendago/internal/teste_benchmarking"
3233
"github.com/fabianoflorentino/aprendago/internal/tratamento_de_erro"
3334
"github.com/fabianoflorentino/aprendago/internal/variaveis_valores_tipos"
3435
"github.com/fabianoflorentino/aprendago/internal/visao_geral_do_curso"
@@ -84,4 +85,5 @@ func HelpMe() {
8485
exercicios_ninja_nivel_11.HelpMeExerciciosNinjaNivel11()
8586
documentacao.HelpMeDocumentacao()
8687
exercicios_ninja_nivel_12.HelpMeExerciciosNinjaNivel12()
88+
teste_benchmarking.HelpMeTesteEBenchmarking()
8789
}

internal/menu/options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import (
5151
"github.com/fabianoflorentino/aprendago/internal/ponteiros"
5252
"github.com/fabianoflorentino/aprendago/internal/seu_ambiente_de_desenvolvimento"
5353
"github.com/fabianoflorentino/aprendago/internal/structs"
54+
"github.com/fabianoflorentino/aprendago/internal/teste_benchmarking"
5455
"github.com/fabianoflorentino/aprendago/internal/tratamento_de_erro"
5556
"github.com/fabianoflorentino/aprendago/internal/variaveis_valores_tipos"
5657
"github.com/fabianoflorentino/aprendago/internal/visao_geral_do_curso"
@@ -98,6 +99,7 @@ func Options(args []string) {
9899
exercicios_ninja_nivel_11.MenuExerciciosNinjaNivel11(args),
99100
documentacao.MenuDocumentacao(args),
100101
exercicios_ninja_nivel_12.MenuExerciciosNinjaNivel12(args),
102+
teste_benchmarking.MenuTesteEBenchmarking(args),
101103
)
102104
}
103105

0 commit comments

Comments
 (0)