Ask coding questions

← Back to all posts
How can i ping my repl that is written in GO.
badsport (0)

The title say it all.
Thanks in advance

Comments
hotnewtop
Coder100 (19278)

Hi! Seeing from past comments, here's a step-by-step tutorial of what is needed.

Step 1: Server

Super simple, add this to your code:

Step 2: Ping

uptimerobot works, https://ping.matdoes.dev is what I use, https://keeper-upper.turbio.repl.co is the official repl.it service. Use whatever you like!

badsport (0)

@Coder100 thnak you 1 million times ill try it out

badsport (0)

@Coder100 i did it and ran it but i have this error:

main

./main.go:21:1: syntax error: non-declaration statement outside function body
./main.go:74:6: main redeclared in this block
previous declaration at ./main.go:17:6
compiler exit status 2

CodingCactus (4320)

so your repl in go is running a web server and you want to ping it? just ping the repl-name.badsport.repl.co link

badsport (0)

@CodingCactus no need for a new file?

CodingCactus (4320)

@badsport why would you need a new file to ping something? You have the webserver set up? just ping it

badsport (0)

@CodingCactus i dont have a webserver set. im new to go

CodingCactus (4320)

@badsport well why are you trying to ping something if you don't have a webserver to ping?

badsport (0)

@CodingCactus i have a file that i want to ping. i know how to make a webserver in py but not go. could you explain it to me?

CodingCactus (4320)

@badsport you aren't supposed to ping a specific file, you are supposed to ping the web server that is made by that file

badsport (0)

@CodingCactus well my file doesnt have a webserver with it

CodingCactus (4320)

@badsport yes because you are supposed to code one in that file

PattanAhmed (1417)

@badsport Hi,
Where to ping?
You mean fork or something else?
Please comment me below!
Thanks!

badsport (0)

@PattanAhmed Like uptimerobot as an example

PattanAhmed (1417)

@badsport Please tell original one:-
Please don't say like
I want to get the idea.
Thanks!!

badsport (0)

@PattanAhmed if uptime robot would work that would be great

PattanAhmed (1417)

@badsport Oh got it...
Check this amazing website...
Enter an URL there of your Repl and click Go
Done!
Click here

Hope this helps

badsport (0)

@PattanAhmed okay thanks for the help and the quick response
https://repl.it/@badsport/... that url?

PattanAhmed (1417)

@badsport Nope!
Paste your Repl URL
Not home page
Thanks!

badsport (0)

@PattanAhmed ah i see so the url that is above the terminal?
https://....badsport.repl.run something like this?

PattanAhmed (1417)

@badsport No!
Your Repl URL like this as an example:-
https://repl.it/@badsport/bramssniper3
Thanks!

badsport (0)

@PattanAhmed thank you you have been a massive help. if it pings can i turn off my machine and the repl will still be running/online?

PattanAhmed (1417)

@badsport Welcome
Happy to help
Hope that helps
Please mark my answer if that helps

badsport (0)

@PattanAhmed thank you but i didnt get it to work

PattanAhmed (1417)

@badsport You mean you don't understand?
Thanks!

badsport (0)

@PattanAhmed no sorry im still getting some errors . im soory for not understanding because im new to Go

PattanAhmed (1417)

@badsport Yes, it will...
It will keep running your Repl even if you close it...
Thanks!

PattanAhmed (1417)

@badsport Solve your issues in the code
And Try!
Anyways, Use that website...
If you want to ping...
https://ping.mat1.repl.co/
Thanks!

Hope this helps
Please mark my answer if this helps