Having problems building syncthing on windows 10

Hello, I have installed go (and git) based on the directions on this document: docs/dev/building.rst at main · syncthing/docs · GitHub

When I reach the last instruction (go run build.go) I get this error:

lib\discover\doc.go:72:1: package comment is detached; there should be no blank lines between it and the package statement

I don’t see any problems with that file. Around line 72 is where the multi-line comment ends and the very next line is a package statement, so there are no blank lines between them.

How should I proceed to fix this hopefully minor issue?

My ultimate goal is to setup an IDE preferably Eclipse (w/ Goclipse Plugin) and debug the program by stepping through it so I can learn more of it’s architecture and how it works. Then hopefully I can add a feature or 2 that I have seen some others request (but that I also want to see).

Mainly this feature to start (these kinda look the same):

Anyway thanks in advance for any help.

You probably have a git configured to convert UNIX line endings into Windows line endings. This may confuse things. See if you can configure your git not to do that (it’s a question at installation time, though I have no idea how to change it after the fact), then clone the source again and it will probably work better.

You can change it after the fact: set core.autocrlf (and/or core.eol depending on what Syncthing’s .gitattributes does, if anything) for that repo, then git rm -rf . && git checkout -- .

Yes I remember that question at setup and I did the recommended, which was to convert. I wonder why it recommends that if it causes issues with this project (and many other I imagine). I’ll try the remedy and see if that fixes. If not I always use Notepad++ on windows to edit… it can easily convert line endings and also correctly formats any doc weather its LF or CRLF ending.

What dir does the period represent in ‘git rm -rf .’ Is that the root of my syncthing git repo?

Nm, I figured it out, it was the C:/src/github.com/syncthing/syncthing dir.

Thanks it compiled without error now. :slight_smile:

1 Like