I have never seen the dot needed, I have used plenty of packages that
are in GOPATH but not GOROOT
On Tue, Jan 19, 2021 at 2:04 PM 'Dan Kortschak' via golang-nuts
wrote:
>
> On Tue, 2021-01-19 at 13:54 -0800, Alexander Mills wrote:
> > i am getting this weird error mes
i am getting this weird error message:
package twitch/go-scripts/dynamo-creators-to-s3/lib is not in GOROOT
(/usr/local/Cellar/go/1.15.6/libexec/src/twitch/go-scripts/dynamo-creators-to-s3/lib)
my GOPATH=$PWD/scripts/go
so there is only 1 GOPATH
[image: Screen Shot 2021-01-19 at 1.52.30 PM.pn
I have this line:
fmt.Printlin("the dao:", dao);
and it logs:
the dao: &{ }
the overall method looks like:
func (dao *UserAttributeDao) GetDecryptedUserAttributes(workflowID string)
(*PayoutUserAttributeRecord, error) {
getItemInput := &dynamodb.GetItemInput{
TableName: aws.String(payoutUser
here is a question I posted on dba.stackexchange:
https://dba.stackexchange.com/questions/282501/variable-number-of-arguments-with-golang
On Sun, Jan 3, 2021 at 2:20 PM Alexander Mills
wrote:
> labels are variable arguments, so I don't know how to do it..i solved it
> for the
need to change the number of question-marks to match
> len(labelStrs), but that's easily done with a helper function. It would be
> nice if a placeholder could be a list and expand accordingly, though.
>
> On Sunday, 3 January 2021 at 09:29:25 UTC Reto wrote:
>
>> O
I have this:
rows, err := c.Database.Db.Query(`
select *, (
select count(*) from mbk_file_label
where file_id = mbk_file.id and label_id IN (
select id
from mbk_user_label
where label_name IN (
'carnivore', 'mammal', 'vertebrate'
)
)
) as xxx
from mbk_file
where user_id = $1
order by xxx DESC
`
, Dec 21, 2020 at 5:54 PM Alexander Mills <
> alexander.d.mi...@gmail.com> wrote:
>
>> this is a little irritating lol, i can get a signed url via:
>>
>> bucket := "bnk-photos"
>> filename := "mypic3.json"
>> method := "PUT&q
PM UTC+1 Kurtis Rader wrote:
>
>> On Mon, Dec 21, 2020 at 2:55 PM Alexander Mills
>> wrote:
>>
>>> this is a little irritating lol, i can get a signed url via:
>>>
>>> bucket := "bnk-photos"
>>> filename := "mypic3.json&quo
this is a little irritating lol, i can get a signed url via:
bucket := "bnk-photos"
filename := "mypic3.json"
method := "PUT"
expires := time.Now().Add(time.Minute * 10)
url, err := storage.SignedURL(bucket, filename, &storage.SignedURLOptions{
GoogleAccessID: cfg.Email,
PrivateKey: cfg.PrivateKe
Yeah sure so it looks like:
clearCurrentLine() // clears the previous status line
fmt.Println("foo")
writeStatusLine() // writes new status line
where clearCurrentLine() is just like
func clearCurrentLine(){
//fmt.Printf("\033[0;") // clear current line
//fmt.Printf("\033[2K\r%d",0);
//fmt.Fp
Forgive me for this pigeon code, I am looking to do something like:
os.Stdout.BeforeWrite(func (){
});
os.Stderr.AfterWrite(func(){
})
so I can hook into the system and clear the terminal before hand, and write
a status line, after wards. Is this possible?
--
You received this message becau
I stole the memory code from here:
https://golangcode.com/print-the-current-memory-usage/
On Thu, Sep 10, 2020 at 4:39 PM Alexander Mills
wrote:
>
> I have this helper func to print memory usage (detect a memory leak?)
>
>
> func PrintMemUsage() {
> var m runtime.MemStats
>
I have this helper func to print memory usage (detect a memory leak?)
func PrintMemUsage() {
var m runtime.MemStats
runtime.ReadMemStats(&m)
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
fmt.Printf("Alloc = %v MiB", bToMb(m.Alloc))
fmt.Printf("\tTotalAlloc = %v MiB", bToMb(m.
It was behaving strangely before adding the waitgroup, my script was
getting stuck
On Thu, Sep 10, 2020 at 11:14 AM burak serdar wrote:
>
> On Thu, Sep 10, 2020 at 11:46 AM Alexander Mills
> wrote:
> >
> > I tried writing this http post request which streams the request b
I am trying to figure out why the wg is seemingly necessary as part of this
code to stream JSON to a post request to ElasticSearch:
https://gist.github.com/ORESoftware/06341057ca39e1b2a47dc8a8e4e4b55f
Any tips appreciated. If the waitgroup is not used, it doesn't appear to
wait until the full r
I tried writing this http post request which streams the request body
line-by-line as JSON.
(This is for an ElasticSearch bulk api request, newline separate JSON in
the request body). I didn't think the waitgroup was necessary, but
apparently the waitgroup is necessary. Does anyone know why? I a
t;must,omitempty"`
>MustNot []HasTermOrMatch `json:"must_not,omitempty"`
>Filter []HasTermOrMatch `json:"filter,omitempty"`
>Should []HasTermOrMatch `json:"should,omitempty"`
> }
>
> This should omit the slice field in the serialized JSON if
This works:
var z interface{}
if err := json.NewDecoder(resp.Body).Decode(&z); err != nil {
t.Fatal(err)
}
but this doesn't work:
if err := json.NewDecoder(resp.Body).Decode(&interface{}{}); err != nil {
t.Fatal(err)
}
and this doesn't work:
if err := json.NewDecoder(resp.Body).Decod
thanks that looks correct to me
On Wednesday, September 2, 2020 at 2:16:30 PM UTC-7 bbse...@gmail.com wrote:
> On Wed, Sep 2, 2020 at 2:49 PM Alexander Mills
> wrote:
> >
> > I have the following code:
> >
> > ```
> > b := bytes.NewBuffer([]byte(""
I have the following code:
```
b := bytes.NewBuffer([]byte(""))
go func() {
for _, v := range z {
jsonStr, err := json.Marshal(&v)
if err != nil {
continue
}
b.Write([]byte(string(jsonStr) + "\n"))
}
}()
fullUrl := fmt.Sprintf("%s/%s", baseUrl, "_bulk")
req, err := http.NewRequest("POST", fu
I have this code used to construct an ElasticSearch json query:
```
type Term = map[string]interface{}
type QueryString = map[string]interface{}
type Range = map[string]interface{}
type Match = map[string]string
type HasTermOrMatch = struct {
Term `json:"term,omitempty"`
QueryString `json:"query_
git didnt exist until 2009 or something lol
On Wed, Aug 5, 2020 at 3:36 AM Mohamed Yousif wrote:
>
> I did small google search and here are the findings
>
> >Brian Kernighan actually wrote the first "hello, world" program as part of
> >the documentation for the BCPL programming language. BCPL wa
I have this go.mod file:
module github.com/channelmeter/err-id-checker
go 1.12
my go version is:
*go version go1.12.10 linux/amd64
*
my imports just look like this:
package main
import (
"bufio"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
)
but when I
hey all I am trying to read the Response from http.Request like so:
func (ctr *Controller) Login(c *common.CPContext, req *http.Request, res
http.ResponseWriter) (int, interface{}) { defer func() {
var code = req.Response.StatusCode; // invalid memory address
or nil pointe
I put the question on Quora:
https://www.quora.com/unanswered/In-Golang-mustdo-means-it-will-panic-if-it-cannot-be-done-Is-here-a-naming-convention-for-will-always-return-error-if-it-cannot-be-done
In Golang "mustdo" means it will panic() if it cannot be done. Is here a
naming convention for "wil
I have been confused about this ever since I started working with Go:
https://gist.github.com/ORESoftware/a6243ce1039cea7e49a22ec8daf90a82
we can do this:
var wg sync.WaitGroup
instead of having to write this:
var wg sync.WaitGroup = sync.WaitGroup{} // is this initialization implicit,
and
it looks like this way works:
https://stackoverflow.com/a/43918797/12211419
know of any others?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsu
I am trying to get an answer to my github gist Q:
https://gist.github.com/ORESoftware/9253433dc0f5af52df8eff7c26e689a0
if anyone knows if this is possible in Golang v1.13+ please lmk
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscrib
28 matches
Mail list logo