Click here to Skip to main content
15,893,486 members
Everything / Programming Languages / Go

Go

Go

Great Reads

by Scott Tattersall
Building a custom-designed PCB for an Internet of Things (IoT), “connected” device from scratch
by Kel_
Building a financial stock explorer app using open-source emitter publish/subscribe, Go and Javascript.
by Lars Paisley
A simple approach to documenting ESB transactions and transformations
by Farhad Reza
This tip describes how we can create a simple window in Go programming language using Win32 API functions.

Latest Articles

by José Cintra
IoT architecture proposal for sensor data acquisition modules using the REDIS database and the GO language
by Bohdan Stupak
Clean architecture example implemented in Go
by Alexey Shtykov
Lot of fancy languages were born and have died since I started working in IT, but a few of them continue their pitiful existance.
by Bohdan Stupak
This article describes a super-minimalistic auth endpoint based on AWS Lambda.

All Articles

Sort by Updated

Go 

30 Jan 2024 by José Cintra
IoT architecture proposal for sensor data acquisition modules using the REDIS database and the GO language
20 Jan 2024 by OriginalGriff
Talk to Google: it's their software, their ads - and they don't get paid until people can see the ads on your site. If nothing else, they can point you at the official doc8umentation which will explain how to use them.
20 Jan 2024 by angry whopper
you guys have any issue with building dashboard for company using google ads API? i have somehow cannot connect the dots between those the dashboard and the API What I have tried: actually i only adding the API
9 Jan 2024 by Member 14760154
I have a query like this var db, err = sql.Open("mssql", connString) if err != nil { log.Println("Open connection failed:", err) } err = db.Ping() if err != nil { log.Println("Cannot connect: ", err) } defer db.Close() if err != nil...
31 Dec 2023 by JohnKeane
I understand you're encountering an issue with API parameters containing special characters like "/". Here's how to solve it: 1. URL-Encode the Parameter: Before constructing the request URL, encode the "search" parameter value using a URL...
29 Dec 2023 by Member 14760154
I Have a problem with my API i have an API with format API routes look like this localhost:8081/getdate/param1/:param1/param2/:param2 it was successfully when i just use a paramater with string, but the problem is when parameter should be...
1 Oct 2023 by Member 12780066
Event MainWindowOnClose is not called when I close window: func Initialize_Objects() { MainWindow = *winc.NewForm(nil) MainWindow.OnClose().Bind(MainWindowOnClose) } func MainWindowOnClose(arg *winc.Event) { MainWindow.Close() } What I...
25 May 2023 by Bohdan Stupak
Clean architecture example implemented in Go
16 Mar 2023 by Member 15953349
This abstract code will display "true" in a loop as long as channel receives new messages. package main import ( "fmt" "sync" ) var a = make(chan bool) var wg sync.WaitGroup func main() { wg.Add(1) go test() for i := 0; i
22 Feb 2023 by Member 15806825
{ "data": null, "errors": [ { "path": [ "createoff" ], "data": null, "errorType": "Lambda:Unhandled", "errorInfo": null, "locations": [ { "line": 2, "column": 3, ...
12 Feb 2023 by Member 14760154
I am new in gin golang, i want to develop api for get course . but i have a problem in routes.go when i put this func Routes(host string) { var router = gin.Default() router.Use(_c.CORSMiddleware()) router.Use(_c.RequestHeaderMiddleware)...
12 Feb 2023 by Andre Oosthuizen
Replace the '&' with '/' as per multiple parameters router.GET("/gradegrades:userid/courseid", ggc.GetDatabyUserID)
9 Feb 2023 by Alexey Shtykov
Lot of fancy languages were born and have died since I started working in IT, but a few of them continue their pitiful existance.
1 Feb 2023 by Member 14760154
I am a new developer , i have a problem about load json result in javascript i have a javascript function to fetch data from API and it was successfull the result is like this { "metadata": { "code": 200, "message":...
1 Feb 2023 by OriginalGriff
Look at the JSON data: response isn't an array, Data is. Have a look here: Working with JSON - Learn web development | MDN[^]
28 Jan 2023 by OriginalGriff
Let me see if I have this right. You've found a full project on GitHub and you want us to review the code, point out any faults to you so you can fix them - assuming you have sufficient skill to do that. OK. I'll do that if you complete my...
7 Dec 2022 by p-shubh
i will be revieving a jwt token from the supabase which is an alternative of firebase and i have to verify it and store its information in a datbase and more over i am unable to connect the supabase to my back-end as i am using golang language...
7 Dec 2022 by Graeme_Grant
I'm not familiar with GO as a language, so I did a quick Google Search: read jwt go - Google Search[^] and can see a number of solutions. Pick one that suits your needs.
20 Nov 2022 by Ronny ronny
you are given two integers N and K, and you need to find two positive integers X and Y such that: X
20 Nov 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
17 Nov 2022 by Member 15806825
PS C:\Users\dddd\go\src\Hdddd> go run main.go *******browse Handler running******* 2022/11/14 14:01:44 http: panic serving 127.0.0.1:65343: runtime error: invalid memory address or nil pointer dereference goroutine 26 [running]:...
23 Oct 2022 by Member 15806825
write a golang code for the problem: Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market: >Product 'A' 'B' Price Per Unit BelugaCaviar 5248 640 128 ChristmasCake 1312 1888 135 GammonJoint 2624...
22 Oct 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
24 Sep 2022 by blueray453
I understand the concept behind major software architectures. Their pros and cons and when to use what, etc. I can implement these my (hacky) way. But not sure whether it is the optimal way (am i missing some design pattern?). My question is,...
24 Sep 2022 by Greg Utas
I know of no such thing, although a few might exist for specific domains. Architecture diagrams and books are intended for software architects: that is, people with a reasonable amount of experience developing software. That experience will give...
10 Aug 2022 by Synco-Cybersyn
I purchased 7 coruses from Udemy to go deep in python,R and ia. Could someone help me to say where should i start, then pass and what should i take last and if i have to return one this courses for a refound by redundant information? please.I...
10 Aug 2022 by Patrice T
Quote: I purchased 7 coruses from Udemy to go deep in python,R and ia. Learning some programming languages is nice, but there is also a huge technical backup not linked to a specific language. You have to know that you can do pretty much...
3 Aug 2022 by Bohdan Stupak
This article describes a super-minimalistic auth endpoint based on AWS Lambda.
30 May 2022 by Bohdan Stupak
This article shows how utilizing lazy evaluation and caching can save us from wasteful computation
4 May 2022 by nocnoc
I ran my code through SonarQube and it suggested me to reduce my code's cognitive complexity. I make use of quite a few nested loops, but I have tried to reduce it to the best of my abilities and would appreciate some suggestions. According to...
21 Jan 2022 by ibilalkayy
db.go func Findaccount(myEmail, myPassword string) bool { collection := Connect.Database("webApp3").Collection("data") collection.FindOne(context.TODO(), bson.M{"email": myEmail}).Decode(&Account) err :=...
21 Jan 2022 by joshun
return (err == nil) How about this?
21 Jan 2022 by Member 13489621
Hi, I am developing a multi-client/single-server project that communicates through sockets. Server Go: The main program listens to a new connection, when a client connects to the server it's handled by a goroutine. On the goroutine I have a...
21 Jan 2022 by Greg Utas
A serious server will be implemented with synchronous (blocking) sockets. Each socket has a thread that waits for stuff to arrive on its socket. All this thread does is put messages on a work queue that an application thread will service. The...
20 Jan 2022 by RickZeeland
You can find an example here: Asynchronous Client Socket Example - .NET Framework | Microsoft Docs[^] If you have a lot of traffic you also might consider queueing.
15 Dec 2021 by ibilalkayy
type List struct { Success bool } func Home(w http.ResponseWriter, r *http.Request) error { if r.URL.Path != "/" { return PageError(w, r) } var user List user = List{ Success: true, } if r.Method == "GET" { return...
11 Dec 2021 by ibilalkayy
controllers.go type List struct { ProductsList []string Description string Link []string Success bool Failure bool } func Home(w http.ResponseWriter, r *http.Request) error { if r.URL.Path != "/" { fmt.Fprintln(w,...
27 Nov 2021 by Mircea Neacsu
Effective management tool for multiple libraries
22 Nov 2021 by MyOldAccount
I have a place in code where database query is performed. Code is not mine and I may not make decisions regarding it's architecture. Recently, we got a task to perform couple of additional queries. My superiors decided to put the additional...
20 Nov 2021 by ibilalkayy
func Home(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/" { fmt.Fprintln(w, "404 page not found") return } for i := 0; i
6 Oct 2021 by OriginalGriff
This is the same question you asked two hours ago: How do I copy a file without overwriting an existing file in golang?[^] The answer does not change in that time, no matter how much you want it to.
6 Oct 2021 by sreeja reddy
I have the below code that copies a text file from a directory to another with overwriting the file if exists What I'm looking for is to copy the file to the destination directory without overwriting, but keep both files. As in Windows for...
6 Oct 2021 by OriginalGriff
Windows itself does this checking for you when you copy'n'paste or drag'n'drop files then if it finds a duplicate if uses a new file name, but your code is expected to know what it is doing, and no such checks are made. If you want to do that,...
4 Oct 2021 by Member 15378947
Hi, I have been struggling with an issue with the usage of int64 inside a struct. When parsing into Json in Go and from the 17th digits onwards I have noticed that it starts round the int64 up. For example: 2882795323592627689 =>...
1 Oct 2021 by Gerry Schmitz
Treat / define the number as a string in JSON; then convert the string to a long int in code. https://yourbasic.org/golang/convert-int-to-string/
30 Jul 2021 by ibilalkayy
base.html {{define "base"}} {{template "title" .}} Home {{if .Loggedin}} ...
28 Jun 2021 by shiva_yn
Hi, I read the following in code. covid-vaccine-tracker/main.go at master · warrensbox/covid-vaccine-tracker · GitHub[^] In this article will notify the covid vaccination information near you. but why these lines are added here I am not...
28 Jun 2021 by Dave Kreskowiak
It's not a fingerprint, or some representation of one, of an actual finger, if that's what you're thinking. It refers to a hash value for the data. But if you want to know what some code is doing, ask the person who wrote it.
6 Jun 2021 by ibilalkayy
func Uploadfile(filename, filepath string) { data, err := ioutil.ReadFile(filename) if err != nil { log.Fatal(err) os.Exit(0) } bucket, err := gridfs.NewBucket( CNX.Database("VWS"), ) if err != nil...
6 Jun 2021 by Richard MacCutchan
Quote: Although the path is correct. The error message is clearly telling you that the path is not correct. I suspect there should be a forward slash at the beginning: "/home/bilal/Videos".
25 May 2021 by vishsword
package main func NbMonths(startPriceOld, startPriceNew, savingperMonth int, percentLossByMonth float64) [2]int { spo := startPriceOld spn := startPriceNew sm := savingperMonth pl := percentLossByMonth x := 100 c := 0.0 diff := spn - sv...
25 May 2021 by OriginalGriff
Go has two basic assignment operators "=" and ":=". The first is a straight assignment, which requires that the variable on the left hand side already exists. The second declares the variable, and gives it a value. If you use the first form...
25 May 2021 by k5054
There's a number of issues here: Firstly you have if ( c % 2 !==0 ), which probably wants to be if ( c %2 != 0 ). But even correcting that and pushing your code through the Go Playground The Go Playground[^] we get a number of errors: ...
6 May 2021 by Azeez Khan
package data import "fmt" type Product struct{ ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Price float32 `json:"price"` SKU string `json:"sku"` ...
1 Apr 2021 by ilanail
Hi everyone, I am a new DevOps developer and I need as my first project to build a script (hopefully it will be shown at the end as dashboard) that will return data about the build and deploy times in OpenShift (need the specific data about...
1 Feb 2021 by jfriedman
When you need a janky [unsafe] way to generate communitive hash codes
1 Jun 2020 by Mohammad Nasirifar
Ways to overcome simple annoying problems that arise while writing code by writing tests
7 Apr 2020 by Rajat93
Tip to help developers migrating to Golang from pure object oriented backgrounds
9 Jan 2020 by ilostmyid2
Hi There's a source (camera) which sends notifications (motion alarms) to port 8085 of a server I've subscribed its IP for it. Maybe in such a negotiation I can't call it 'server', but it's our server which serves some other things. I've written two programs for receiving and echoing current...
30 Dec 2019 by Ri Xu
This post shows you how to import and export Excel XLSX in Go language.