Skip to content

feat(challenges): add Go coding challenges (#2) - #5

Open
fguzman-stack wants to merge 1 commit into
masterfrom
feat/go-challenges
Open

fguzman-stack wants to merge 1 commit into
masterfrom
feat/go-challenges

Conversation

@fguzman-stack

Copy link
Copy Markdown
Owner

🎯 What does this PR do?

Adds 10 Go coding challenges (ids 211-220) to ChallengesData.kt covering arrays vs slices, append semantics, the "declared and not used" rule, goroutines + sync.WaitGroup, defer ordering, exported identifiers, the idiomatic error-handling convention and variable shadowing. Mixes TRIVIA, DEBUG and PRINT types. Also wires Go as a selectable language in the UI.

Closes #2

🧩 Challenges added

  • Arrays vs slices (value copy vs view)
  • len/cap on subslices and append
  • declared and not used compile error
  • Waiting for goroutines with sync.WaitGroup
  • defer LIFO order + argument evaluation timing
  • Exported (uppercase) visibility
  • Idiomatic if err != nil

All codeSnippets were validated with go run on go1.26 locally: the PRINT ones produce exactly the documented output (3 4, b/a, 2 3, 2/1, 210) and the DEBUG one reproduces the real declared and not used: x error.

πŸ–ΌοΈ UI wiring

  • ic_lang_go.xml (gopher face vector) + mapping in TopicIcons.kt
  • Added "Go" to language selector (SettingsLanguageScreen), badges list (LearnScreen, key GO), and Focus topics

βœ… Before you submit

  • ./gradlew testDebugUnitTest passes locally (BUILD SUCCESSFUL)
  • No Room schema changes (language is a TEXT key, no migration needed)
  • No secrets/keystores committed
  • Conventional commit title

πŸ§ͺ How to test

  1. Settings β†’ Lenguajes y temas β†’ "Lenguaje Principal" β†’ pick Go
  2. Aprender β†’ "Retos Normales": solve Go challenges (trivia/print/debug)
  3. Insignias tab shows a Go progress row
  4. Focus β†’ topic list includes Go

πŸ“ Note: independent from #4 (branched off master). Whoever merges second will need a trivial conflict resolution in ChallengesData.kt / the language lists (both PRs touch the same append points).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧩 Add Go coding challenges

2 participants