|
You are here |
blog.percywegmann.com | ||
| | | | |
lukesingham.com
|
|
| | | | | These are my summary notes of 'A Tour of Go' - which is meant for people who are familiar with programming to have a quick tour | |
| | | | |
www.alexedwards.net
|
|
| | | | | ||
| | | | |
konradreiche.com
|
|
| | | | | Writing a generic protobuf writer in Go is straightforward. We simply use proto.Marshal with the protobuf message because proto.Marshal expects the proto.Message interface, which all generated protobuf messages implement. However, when it comes to reading serialized protobuf data into a specific Go type, historically, we had to specify the type explicitly: var post pb.Post if err := proto.Unmarshal(b, &post); err != nil { return nil, err } This approach is clear and explicit: what you see is what you get. But what if you need a more generic solution? You might encounter a scenario similar to mine: a cache abstraction designed to handle different kinds of protobuf messages generically. My initial attempt looked like this: | |
| | | | |
componenthouse.com
|
|
| | | I wanted tocompare how Java, C++ and C perform whenreading a text file line by line and printing the output. I've implemented some possibilities and, at the end, we can compare the speed of each execution. Java 7 version (BufferedReader) import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main7 { private static final... | ||