dongliao6777 2019-09-21 22:17
浏览 46
已采纳

Github fork中的更改未导入

I'm writing a MIDI parser that splits apart MIDI files and adjusts the volume on different tracks to allow for specific voice isolation to help practicing. I'm using a Go library, EasyMIDI. However, I ran into a use case that the library didn't cover, so I forked the repo and made changes that should fix my issues in the short term.

I'm able to successfully build when using my forked Github URL in my go.mod and import statements, but the code changes I made aren't being reflected. I added the function GetChannel() to an interface, and so should see it listed as an option. When I click into the source for another function that was originally implemented, I see that my VSCode is referencing the non-forked repo when grabbing the code (see screen snippet below).

VSCode Screen Snippet

As you can see on the left, there is no GetChannel() function. If I click on "algo!guy" and select "!try431", I do see the changes I made and pushed to my fork. How do I get my code to recognize that I want my forked repo so I can get access to these changes I've made?

Edit: Thought I might as well throw in the go.mod and go.sum files that are generated upon a go build.

go.mod

module github.com/Try431/acc-midi-splitter

go 1.12

require github.com/Try431/EasyMIDI v0.0.0-20190921213858-238fe2946087

go.sum

github.com/Try431/EasyMIDI v0.0.0-20190921213858-238fe2946087 h1:dXDwjgIHMgL4zow9ixgTslZ3cWZHHIu3+FurDjDC6wA=
github.com/Try431/EasyMIDI v0.0.0-20190921213858-238fe2946087/go.mod h1:c/dd/WkUR9yfzjC9sPO9J0vh5TzTmE8ryAvEviTDwgg=
github.com/algoGuy/EasyMIDI v0.0.0-20180322051653-708ca39e7399 h1:f0h3xTKQjrTzAUwqMJr1TY3lk3gTK8R4v7ZjcSMiwm8=
github.com/algoGuy/EasyMIDI v0.0.0-20180322051653-708ca39e7399/go.mod h1:z6svyEeOasADFxg4gn6funK2OBjocr62B4J7ZPodCPs=

I've tried deleting the algoGuy lines in the go.sum, but obviously the lines are put back on a go build.

  • 写回答

1条回答 默认 最新

  • dtlhy0771 2019-09-21 22:28
    关注

    You can use a replace statement in go.mod:

    replace original => fork
    

    This should make references to the original repo in the forked source lookup from the forked repo.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改