Syntax error when declaring a function?

Hello everyone, I’m new to Golang programming, and I’m working on a project that uses an existing package on Github, but when I tried to build it, it gave me some syntax errors: (the code is too long so I copied the concerned parts)

github.com/shravan9912/backend

…/…/github.com/shravan9912/backend/scheduler.go:127:23: invalid character U+005C ‘’
…/…/github.com/shravan9912/backend/scheduler.go:190:72: syntax error: unexpected bool, expecting comma or )
…/…/github.com/shravan9912/backend/scheduler.go:242:74: syntax error: unexpected bool, expecting comma or )
…/…/github.com/shravan9912/backend/scheduler.go:243:2: syntax error: unexpected if, expecting expression

first error: sch.dumpAgent.Setup()
I removed the \ character
second error:
func (sch *scheduler) getRetransmission(s *session) (hasRetransmission bool, retransmitPacket *ackhandler.Packet, pth *path) {

}
third error:
func (sch *scheduler) selectPathRoundRobin(s *session, hasRetransmission bool, hasStreamRetransmission bool, fromPth *path) *path {

}
fourth error:
if sch.quotas == nil {
sch.setup()
Go version: go1.16
os: linux
Thank you so much for you help…

It looks like your setup function is missing one or two closing } around line 187.

1 Like

Thank you so much for your reply. I really appreciate your help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.