Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduce go-mnd
Search
Tommy Mühle
February 06, 2020
Programming
0
150
Introduce go-mnd
Short introduction of go-mnd, the magic number detector for Go.
Tommy Mühle
February 06, 2020
Tweet
Share
More Decks by Tommy Mühle
See All by Tommy Mühle
Useful daily business packages
tommymuehle
1
100
Enums - An introduction
tommymuehle
0
250
Defensive programming
tommymuehle
10
1.4k
Why setters are bad
tommymuehle
2
760
Keep yourself up to date
tommymuehle
0
260
Exception handling - classic and fancy
tommymuehle
3
640
Other Decks in Programming
See All in Programming
クラウドに依存しないS3を使った開発術
simesaba80
0
210
Implementation Patterns
denyspoltorak
0
140
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
900
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
AtCoder Conference 2025
shindannin
0
880
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
150
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2k
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
470
TestingOsaka6_Ozono
o3
0
260
AIエージェントの設計で注意するべきポイント6選
har1101
6
2.9k
ゲームの物理 剛体編
fadis
0
390
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
9
35k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
140
Accessibility Awareness
sabderemane
0
29
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
420
Amusing Abliteration
ianozsvald
0
80
The Invisible Side of Design
smashingmag
302
51k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
43
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
220
Discover your Explorer Soul
emna__ayadi
2
1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Transcript
Tommy Mühle | tommy-muehle.io Tommy Mühle Software Engineer and Author
1
Tommy Mühle | tommy-muehle.io Introduce go-mnd 2
Tommy Mühle | tommy-muehle.io A vet analyzer to detect magic
numbers 3
Tommy Mühle | tommy-muehle.io Magic number? 4
Tommy Mühle | tommy-muehle.io Tommy Mühle | tommy-muehle.io A magic
number is a numeric literal that is not defined as a constant, but which may change, and therefore can be hard to update. 5
Tommy Mühle | tommy-muehle.io Hide intention 6
Tommy Mühle | tommy-muehle.io Hard to change 7
package main import `github.com/google/go-github/github` func main() { var repo github.Repository
// ... if repo.GetTeamID() == 12 { // ... } } Tommy Mühle | tommy-muehle.io 8
package main import `github.com/google/go-github/github` const TeamEngineering = 12 func main()
{ var repo github.Repository // ... if repo.GetTeamID() == TeamEngineering { // ... } } Tommy Mühle | tommy-muehle.io 9
Tommy Mühle | tommy-muehle.io How it works 10
Tommy Mühle | tommy-muehle.io 11 >= 1.12
Tommy Mühle | tommy-muehle.io Supported checks 12
package main import ( "net/http" "time" ) func main() {
client := &http.Client{ Timeout: 5 * time.Second, } // ... } Tommy Mühle | tommy-muehle.io 13 Assignment
Tommy Mühle | tommy-muehle.io 14 package main import ( "fmt"
"time" ) func main() { t := time.Now() switch { case t.Hour() < 12: fmt.Println("Good morning!") default: fmt.Println("Good evening.") } } Case
package main import "net/http" func handler(w http.ResponseWriter, r *http.Request) {
// ... http.Error(w, http.StatusText(404), 404) } Tommy Mühle | tommy-muehle.io 15 Argument
package main type queue struct { // ... } //
... func (q *queue) MaxLength() int { return 500 } Tommy Mühle | tommy-muehle.io 16 Return
package main func main() { var y int // ...
x := y * 100 // ... } Tommy Mühle | tommy-muehle.io 17 Operator
Tommy Mühle | tommy-muehle.io 18 package main func main() {
var x int // ... if x > 100 { // ... } } Condition
Tommy Mühle | tommy-muehle.io Demo 19
Tommy Mühle | tommy-muehle.io 20
Tommy Mühle | tommy-muehle.io 21
Tommy Mühle | tommy-muehle.io 22
Tommy Mühle | tommy-muehle.io 22
Questions?
Thank you! Slides http:/ /bit.ly/2pTywBB @tommy_muehle