Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codewars

Solutions for codewars problems I am not too ashamed to put on github.

from Codewars wiki: Codewars is a community of developers, who are called Code Warriors (or just warriors), that train on improving their development skills. Think of it like a coding dojo - where developers train with each other and help each other get better through practice

Programming languages are Go and PHP.

My current codewars rank:

Setup

Go Module Initialization

To run Go tests, initialize the module from the root directory:

go mod init github.com/freedom-shelby/codewars

Then you can run tests in any kata folder:

cd 8kyu/even_or_odd
go test              # Runs default solution (main.go)
go test -tags v2     # Runs alternative solution (solution2.go)

Build Tags Explained

The build tags at the top of files (e.g., //go:build !v2) are essential for the testing system:

  • main.go uses //go:build !v2 to exclude it when running with -tags v2
  • solution2.go uses //go:build v2 to include it only when running with -tags v2
  • Without these tags, Go would try to compile both files together, causing duplicate function definition errors

Important: Do not remove the build tag comments - they enable switching between different solution implementations.

About

My Codewars Solutions

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages