Rearranged things to be more idiomatic and logical
This commit is contained in:
@@ -88,10 +88,6 @@ folder at the root of the repository.
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
This tutorial was developed on a system running Pop OS based on Ubuntu 21. As
|
|
||||||
such there may be some small differences compared to Ubuntu 20, but protobuf
|
|
||||||
will still be version 3.
|
|
||||||
|
|
||||||
In general, you will be deploying your binaries to systems also running ubuntu
|
In general, you will be deploying your binaries to systems also running ubuntu
|
||||||
20 or 21 or similar, on x86-64 platform, so the same instructions can be used in
|
20 or 21 or similar, on x86-64 platform, so the same instructions can be used in
|
||||||
setting up a fresh server when deploying. We will not cover Docker or any other
|
setting up a fresh server when deploying. We will not cover Docker or any other
|
||||||
@@ -314,7 +310,8 @@ why the tutorial uses such a simple application.
|
|||||||
To run the protobuf compiler and generate the code, from the root of the
|
To run the protobuf compiler and generate the code, from the root of the
|
||||||
repository you run the following command:
|
repository you run the following command:
|
||||||
|
|
||||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./pkg/proto/based32.proto
|
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. \
|
||||||
|
--go-grpc_opt=paths=source_relative ./pkg/proto/based32.proto
|
||||||
|
|
||||||
`--go_out` is essential for when generating Go versions of the protobuf handler
|
`--go_out` is essential for when generating Go versions of the protobuf handler
|
||||||
code. Without this, the remaining options are not understood.
|
code. Without this, the remaining options are not understood.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ package based32
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/base32"
|
"encoding/base32"
|
||||||
"github.com/quanterall/kitchensink"
|
"github.com/quanterall/kitchensink/pkg/codec"
|
||||||
"github.com/quanterall/kitchensink/pkg/proto"
|
"github.com/quanterall/kitchensink/pkg/proto"
|
||||||
"lukechampine.com/blake3"
|
"lukechampine.com/blake3"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -244,8 +244,9 @@ func makeCodec(
|
|||||||
// and won't decode as it is expected.
|
// and won't decode as it is expected.
|
||||||
if !strings.HasPrefix(input, cdc.HRP) {
|
if !strings.HasPrefix(input, cdc.HRP) {
|
||||||
|
|
||||||
log.Printf("Provided string has incorrect human readable part:"+
|
log.Printf(
|
||||||
"found '%s' expected '%s'", input[:len(cdc.HRP)], cdc.HRP,
|
"Provided string has incorrect human readable part:"+
|
||||||
|
"found '%s' expected '%s'", input[:len(cdc.HRP)], cdc.HRP,
|
||||||
)
|
)
|
||||||
|
|
||||||
err = proto.Error_INCORRECT_HUMAN_READABLE_PART
|
err = proto.Error_INCORRECT_HUMAN_READABLE_PART
|
||||||
|
|||||||
Reference in New Issue
Block a user