Tag: code

Summary: How to Write Go Code

Summary: How to Write Go Code The code organization follows repository -> module -> packages. Use go mod init and initialize module root as desired e.g. example.com/user/hello The Go binary goes to the path set in GOBIN All imported modules are stored in GOPATH/pkg/mod subdirectory The command go clean -modcache cleans downloaded packages. Reference https://golang.org/doc/code.html Written with StackEdit.

Notes on Python Decorator

Notes on Python Decorator Python decorator is a function wrapper. It helps you wrap essential tasks around your functions such as logging, ratelimits, metrics updates etc. However, it has a peculiar behavior due to its dynamic implementation. If you run the following code, what is the expected output? def register(func): print(“hello to decorator!”) def another(): ┆ print(“wrapped now!”) ┆ func()…