# why cant i start syncthing with the main.go

**URL:** https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545
**Category:** Development
**Created:** [August 5, 2024, 12:50pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545 "2024-08-05T12:50:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ZajdoSmurf](https://forum.syncthing.net/user_avatar/forum.syncthing.net/zajdosmurf/32/16899_2.png) [@ZajdoSmurf](https://forum.syncthing.net/u/ZajdoSmurf)
#### Post date: [August 5, 2024, 12:50pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/1 "2024-08-05T12:50:02Z")

</div>

hello so im trything to run the cmd\syncthing\main.go i saw that there is the code where it actualy starts syncthing , but when i try to run it it i get random errors in the api like undefined: auto.Assets?

---

<div class="post-metadata">

### Author: ![acolomb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/acolomb/32/11343_2.png) [@acolomb](https://forum.syncthing.net/u/acolomb)
#### Post date: [August 5, 2024, 2:01pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/2 "2024-08-05T14:01:35Z")

</div>

You can’t run it like that. The build script does some additional steps, such as bundling the GUI HTML assets. So you need to call `build.go` first and then run `bin/syncthing`. See [Building Syncthing — Syncthing documentation](https://docs.syncthing.net/dev/building.html)

---

<div class="post-metadata">

### Author: ![ZajdoSmurf](https://forum.syncthing.net/user_avatar/forum.syncthing.net/zajdosmurf/32/16899_2.png) [@ZajdoSmurf](https://forum.syncthing.net/u/ZajdoSmurf)
#### Post date: [August 5, 2024, 2:45pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/3 "2024-08-05T14:45:09Z")

</div>

i know but it should work somehow like that too cus i cant just but those binarys in my project . i want to be abble to start syncthing using pure code like this go run main.go and it shoudl start syncthing

---

<div class="post-metadata">

### Author: ![acolomb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/acolomb/32/11343_2.png) [@acolomb](https://forum.syncthing.net/u/acolomb)
#### Post date: [August 5, 2024, 2:47pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/4 "2024-08-05T14:47:55Z")

</div>

Then I guess you need to develop a patch that optionally removes the dependency on the `auto` package and uses the `STGUIASSETS` directory only. I can’t say whether that is the only needed change though. Syncthing source code is designed to be built first and then run, as documented.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [August 5, 2024, 8:49pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/5 "2024-08-05T20:49:45Z")

</div>

Run packages, not files.

```plaintext
% go generate ./...
% go run ./cmd/syncthing

```

---

<div class="post-metadata">

### Author: ![ZajdoSmurf](https://forum.syncthing.net/user_avatar/forum.syncthing.net/zajdosmurf/32/16899_2.png) [@ZajdoSmurf](https://forum.syncthing.net/u/ZajdoSmurf)
#### Post date: [August 6, 2024, 7:37am UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/6 "2024-08-06T07:37:01Z")

</div>

thank u sir , i appriciate it 😃

---

<div class="post-metadata">

### Author: ![ZajdoSmurf](https://forum.syncthing.net/user_avatar/forum.syncthing.net/zajdosmurf/32/16899_2.png) [@ZajdoSmurf](https://forum.syncthing.net/u/ZajdoSmurf)
#### Post date: [August 7, 2024, 2:58pm UTC](https://forum.syncthing.net/t/why-cant-i-start-syncthing-with-the-main-go/22545/7 "2024-08-07T14:58:58Z")

</div>

hey jakob , is it possible maybe just to take the syncthing package in cmd . and create a new project with just that package and start it? is it possible to generate somehow so i can get past the undefined auto.Assets . you method worked but im creating an project and i dont want to have to put the whole sorcecode of syncthing in my project so im searching for a way to look it more profesional
