GoReflectionTalk
GopherCon 2016
Install / Use
/learn @candysmurf/GoReflectionTalkREADME
Reflection - Standard Library
Developers are often told reflection is bad and should be avoided. However, when reflection can help reduce the amount of code needed to solve a problem, it should be considered. Reducing complexity while preserving maintainability must always be a priority. Reflection can be a tool that helps makes this possible. In this talk I am going to show you the power and elegance of the reflection package.
https://candysmurf.github.io/GoReflectionTalk
Links
http://blog.golang.org/laws-of-reflection
Code Review
Basics
Example shows how to reflect over a struct type value.
Struct Types (Go Playground)
Example shows how to reflect over a slice of struct type values.
Slices (Go Playground)
Example shows how to reflect over a map of struct type values.
Maps (Go Playground)
Example shows how to reflect over a struct type pointer.
Pointers (Go Playground)
Interfaces
Example shows how to reflect over a struct type value that is stored inside an interface value.
Struct Types (Go Playground)
Example shows how to reflect over a slice of struct type values that are stored inside an interface value.
Slices (Go Playground)
Example shows how to reflect over a map of struct type values that are stored inside an interface value.
Maps (Go Playground)
Example shows how to reflect over a struct type pointer that is stored inside an interface value.
Pointers (Go Playground)
Inspection / Decoding
Example shows how to inspect a structs fields and display the field name, type and value.
Struct Types (Go Playground)
Example shows how to use reflection to decode an integer.
Integers (Go Playground)
All material is licensed under the Apache License Version 2.0, June 2016.
Related Skills
node-connect
332.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
332.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.9kCommit, push, and open a PR
