// the find
nimajalali/go-force
Go (golang) library for calling Salesforce.com (force.com) web api's
A Go client for the Salesforce REST API covering sobject reads and writes, SOQL queries, API limits, and OAuth login. It suits Go services that need to pull or push records and are willing to map their custom objects onto structs by hand.
- The force:"Field__c" struct tag maps Salesforce field names directly onto Go struct fields, and sobjects.BaseSObject with an ApiName() method gives each custom object a typed shape, so query results decode into real structs rather than maps.
- The forcejson package has its own encoder and decoder, with a file layout that mirrors encoding/json and its own tests and benchmarks. The tag handling is a deliberate layer, not a patch around the stdlib.
- The surface is small: one force package split into OAuth, query, sobject, and limits files, each with a matching _test.go. It is quick to read and easy to fork.
- Last push was July 2023. The Create call takes an API version string, and Salesforce releases new versions several times a year, so check that the calls still behave before relying on it. The badges still point at godoc.org rather than pkg.go.dev.
- The only login path in the README is username, password, and security token. The server-to-server flows Salesforce now recommends, such as JWT bearer and connected apps, are not in the README or the listed files.
- The README example prints the error from GetSObject and carries on, so a failed call still prints an empty struct. People will copy that pattern.
- Nothing in the listed files points at Bulk API or Composite support, so loading many records would mean one HTTP request per record.