Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-merkledag
Commits
34af3382
Commit
34af3382
authored
Aug 07, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add two checks to make sure we never update the protobuf files
parent
5d5535f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
coding.go
coding.go
+5
-0
pb/merkledag.pb.go
pb/merkledag.pb.go
+9
-0
pb/upgrade_check.go
pb/upgrade_check.go
+5
-0
No files found.
coding.go
View file @
34af3382
...
@@ -13,6 +13,11 @@ import (
...
@@ -13,6 +13,11 @@ import (
ipld
"github.com/ipfs/go-ipld-format"
ipld
"github.com/ipfs/go-ipld-format"
)
)
// Make sure the user doesn't upgrade this file.
// We need to check *here* as well as inside the `pb` package *just* in case the
// user replaces *all* go files in that package.
const
_
=
pb
.
DoNotUpgradeFileEverItWillChangeYourHashes
// for now, we use a PBNode intermediate thing.
// for now, we use a PBNode intermediate thing.
// because native go objects are nice.
// because native go objects are nice.
...
...
pb/merkledag.pb.go
View file @
34af3382
...
@@ -31,6 +31,15 @@ import strconv "strconv"
...
@@ -31,6 +31,15 @@ import strconv "strconv"
import
bytes
"bytes"
import
bytes
"bytes"
// DoNotUpgradeFileEverItWillChangeYourHashes warns users about not breaking
// their file hashes.
const
DoNotUpgradeFileEverItWillChangeYourHashes
=
`
This file does not produce canonical protobufs. Unfortunately, if we change it,
we'll change the hashes of the files we produce.
Do *not regenerate this file.
`
// Reference imports to suppress errors if they are not otherwise used.
// Reference imports to suppress errors if they are not otherwise used.
var
_
=
proto
.
Marshal
var
_
=
proto
.
Marshal
var
_
=
math
.
Inf
var
_
=
math
.
Inf
...
...
pb/upgrade_check.go
0 → 100644
View file @
34af3382
package
merkledag_pb
// Make sure the user doesn't upgrade this package!
// This will fail to build if the user does.
const
_
=
DoNotUpgradeFileEverItWillChangeYourHashes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment