Type Signatures and Cloud Storage
Meetup #26 was virtual again and we were glad to meet Gophers from Leipzig and beyond. We had a two short talks and code walkthroughs on type signatures and rclone, a cloud storage tool.
Type Signatures
How would you generate a unique fingerprint for a type? A fingerprint that would change, even if the name of the type stays the same, but e.g. fields in a struct are renamed, added or removed?
The term Type Signature is often used in the context of functions and methods and contains name and parameters of a function.
In Java, we have serialVersionUID:
If a serializable class does not explicitly declare a
serialVersionUID
, then the serialization runtime will calculate a defaultserialVersionUID
value for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification. However, it is strongly recommended that all serializable classes explicitly declareserialVersionUID
values, since the defaultserialVersionUID
computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassExceptions during deserialization.
In case of struct types, one way would be to serialize the zero value of the type and compute some hash, e.g. FNV or other.
Cloud storage tool: rclone
Rclone is a
command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.
Beside file transfers rclone allows to mount filesystems, analyze disk usage (similar to ncdu) and expose cloud storage providers with classic protocols like FTP, webdav or http.
Find out more: The rsync for the cloud era: Rclone.
Misc
- rclone does not seem to support upspin (nor ipfs, for that matter)
- in 2022 go is still niche! 152 vs 3420 jobs for “golang” vs “java” (are you looking for a “golang” job? check out: aboutyou.de/jobs)
- for more unusual uses of reflect (laws) take a look at: https://github.com/kstenerud/go-subvert
- tricky things: Go interfaces, the tricky parts, Go Gotchas
- new things: Go 1.18 with some fuzzing and a focus on generics
- large changes in Go 1.18 like generics and fuzzying are seemingly not used by all projects immediately (example: mockery)
- postgres go driver: lib/pq, jackc/pgx/v4; a new kind of ORM for Go: bun
- for quick online tools: CyberChef
- more interactive online things: https://messwithdns.net
- sad, but true as ever: https://xkcd.com/2347 (discussing jq)
- tiny demo: we had a short demo of a Go program called runpad, collaborative code editing - related to mob programming
Join our meetup to get notified of upcoming events!