Fix go importing#9
Merged
Merged
Conversation
This is attempt two, as the first attempt, bf66a6a, only worked locally when using a go.mod require directive. When grabbing a module remotely, Go assumes that all dependent code is in the last directory, e.g. go get github.com/smoeding/tree-sitter-puppet/bindings/go Grabs everything in /go and below, so compilation fails, since the C code in the parent directory cannot be found. This problem does not occur in local development however, since the parent directory does exist, which is why adding a require directive masks the problem. Instead we want to use the go.mod file /tree-sitter-puppet/go.mod and delete tree-sitter-puppet/bindings/go.mod. Then a go get will grab the C code as well. This is also how other tree-sitter bindings are setup: https://github.com/tree-sitter-grammars/tree-sitter-yaml Two other changes are made: 1. Switch the Go tree-sitter bindings from github.com/smacker/go-tree-sitter to github.com/tree-sitter/tree-sitter-puppet, as the latter are unmaintained. 2. Add an indirect dep on github.com/mattn/go-pointer
Owner
|
I don't use the Go bindings, so I won't be able to help here ;-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is attempt two, as the first attempt,
bf66a6a, only worked locally when using a go.mod require directive.
When grabbing a module remotely, Go assumes that all dependent code is in the last directory, e.g.
go get github.com/smoeding/tree-sitter-puppet/bindings/go
Grabs everything in /go and below, so compilation fails, since the C code in the parent directory cannot be found.
This problem does not occur in local development however, since the parent directory does exist, which is why adding a require directive masks the problem.
Instead we want to use the go.mod file /tree-sitter-puppet/go.mod and delete tree-sitter-puppet/bindings/go.mod. Then a go get will grab the C code as well.
This is also how other tree-sitter bindings are setup:
https://github.com/tree-sitter-grammars/tree-sitter-yaml
Two other changes are made: