using %#v
as in
https://play.golang.org/p/VVqUVsfzx6e
log.Printf("Hello, playground %#v\n", ret)
On Saturday, February 17, 2018 at 7:05:42 PM UTC-5, Joseph Lorenzini wrote:
>
> Hi all:
>
> Per documentation:
>
> "If an operand implements the error interface, the Error method will be
>
Thanks for gathering this info, and the work you all put into Go, but I
just went to answer it and I wonder how many people are going to answer
this one wrong:
What are the preferred languages at your company? (top 4)
(Please list up to 4, 1 = most preferred)
scale is 1 to 4, in most surveys, t
Hi,
At work we get pgp encrypted files from different vendors, when our app
tries to decrypt the file from one of them, I get:
openpgp: invalid data: tag byte does not have MSB set
But if I use the gpg command line, I'm able to decrypt it.
Part of the verbose output from gpg when it decrypts
Check this repository
https://github.com/fmpwizard/mrwilson
* It runs a very simple https service
* Gets certificates using Let's Encrypt
* Has ansible playbook to run the app under systemd
feel free to ask any questions.
Diego
On Thursday, November 22, 2018 at 10:14:52 PM UTC-5, Tong Sun w
> I'm not looking for an service/socket example,
if the service part is in reference to the repo I posted, where I said
service, you can just assume I said an http endpoint you can visit with
your browser, and it will return a status code, like
curl -v https://mrwilson.one/status
* Trying 4
Hi,
For what you described, I wouldn't even use Docker (not trying to get into
flame wars, just my opinion that not using it will keep your setup even
simpler)
Some time ago I wrote this
https://github.com/fmpwizard/mrwilson/tree/master/ansible
it's a complete ansible set of playbooks, roles,
I think we have a similar setup to what you are trying to do, we also
started with Scala and about 3 years ago we moved it to Go (still use Scala
for other parts of our app).
While working in Scala and other languages you are encourage to abstract
things as much as you can, in Go it is often be
; So do you mean the way to do it is to hardcode most of functionality. No
> need to use custom types, interfaces. Just plain text parsing?
>
> In that case, how easy is it to evolve or refactor the code?
>
> Thanks
>
> On Wednesday, July 26, 2017 at 8:36:15 PM UTC+2, Dieg
Hi,
At work we have all of our deployment logic written in ansible and simply
call an ansible playbook from jenkins (gitlab-ci in your case)
Here is a sample project using ansible
https://github.com/fmpwizard/mrwilson/tree/master/ansible
it has all the roles, code, etc needed to start with a
This
https://github.com/jpillora/overseer
may do what you need or at least give you an idea of what you can do.
The way oveerseer works is, you start your app, when you send a particular
kill signal, it keeps the running app running and it spawns a duplicate, it
passes new http requests to the
Hi,
I have a project with a package main and then a few other packages inside
it, something like:
$GOPATH//src/github.com/me/project-name
$GOPATH//src/github.com/me/project-name/packagea
$GOPATH//src/github.com/me/project-name/packageb
if I run
go build -gcflags "-m -m"
at $GOPATH//src/github
AM, James Bardin wrote:
>
>
> On Thursday, September 14, 2017 at 10:58:27 AM UTC-4, Diego Medina wrote:
>>
>>
>> go build -gcflags "-m -m" github.com/me/project-name/packagea and
>> nothing prints out,
>>
>>
>>
> Nothing printed becaus
Hi,
Probably not the answer you were expecting, but :
> The nonces must be received by the host in ascending order.
is going to fail sooner or later, no matter which trick/feature you use. A
more robust solution would be to code the server to accept unordered
requests and handle them gracefull
>
>
> This is exactly what I was trying to figure out how I would be able to do,
> and more specifically, if there's an easy way to find out.
>
>
the pprof tool can read a memory or cpu profile created during your
benchmark, and then you can see details of your function, line by line, and
see
If it is something like weekdays (very few options), I don't see any issues
with it. Stringer is great when as you go along using your app, you may
need to add more values over time.
using iota and stringer is great when your list may be 15 or more items,
and keeping them updated becomes a chor
Hi,
I need to parse datetime data given in a csv file, the format I get (I get
a lot of diff ones but the latest is):
20060102 15:04:05:000
but if I use that with time.Parse, it doesn't parse the millisecond part,
tells me:
parsing time "20170628 12:11:00:103" as "20060102 15:04:05:000": cann
t 31, 2017 at 4:47 AM, Jim Cote
> > wrote:
>
>> See https://golang.org/src/time/format.go?s=23626:23672#L249. The
>> standard library is explicitly looking for the period. Your easiest
>> solution would be to just write your own parser.
>>
>>
>> On M
I have been using https://github.com/FiloSottile/gvt for years, it's great,
simple, you vendor only what you want, so, in this case, that one lib you
are talking about
you can even leave the imports as they are, but point to your own fork of
the repo by modifying the manifest file
for example,
replied on the mgo list
https://groups.google.com/d/topic/mgo-users/F3LbWdyPGDc/discussion
(pasted here to save a click)
Hi,
> the checkbox is unchecked and form is submitted to save. Now as I have
applied "omitempty"
if the checkbox is unchecked, your client side code should send "false" t
Hi,
At work I have 3 different xml files I need to parse (different fields
each), Because going from the xml bytes into a struct is pretty much the
same
for all 3 types, I thought I could do something like
var payload interface{}
if kind == "A" {
paylaod = TypeA{}
}
if kind == "B" {
pay
Unmarshal(data, intf)
>
> This boxing is exactly the same thing that happens automatically in the
> first function call.
>
> //jb
>
>
> On 16 Nov 2017, at 21:52, Diego Medina wrote:
>
> Hi,
>
> At work I have 3 different xml files I need to parse (different f
Don't do relative imports (littlelang/tokenizer) or . littlelang/tokenizer
. Unless you want to run into corner cases with tools not knowing where
code is defined or if you want to confuse other developers.
Using the full path makes it very clear where the code is, yes, if you move
things aroun
The use of SyncWrites=false on badger's benchmark was called out on reddit
and the benchmark author's reply was along the lines of "it's ok for our
use case to lose the last few [seconds|ms] of data"
You draw your conclusion on where you want to keep your data.
On Thursday, January 18, 2018
As a regular user, I wouldn't expect go get to give me v1 all the time, I
would expect to get all kinds of breaking builds all the time because that
is the reality of go get.
And for those who enter tickets asking why? I would nicely explain that go
get is the quick and dirty way to get started
You can run a go routine similar to:
go func() {
log.Fatal(http.ListenAndServe(":80", http.HandlerFunc(httpToHTTPS)))
}()
//httpToHTTPS redirects all http to https
func httpToHTTPS(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "https://"+r.Host+r.URL.String(),
http.
during code review.
To apply you can email your CV in pdf format to diego.med...@cssregtech.com
(if the address is hidden by google, use my first name dot last name and
the domain is cssregtech.com )
Thanks
Diego Medina
VP Engineering
https://www.ascendantcompliancemanager.com/
--
You re
Hi,
You may want to look at
https://golang.org/pkg/expvar/
If your app is already running the built in server, you can
import _ "expvar"
and then you will see a lot of internal counters at
localhost:6060/debug/vars
you can then add your own counters to it, which will also be displayed
und
You could also use
https://equinox.io/
once you have your token. keys, etc all setup, you can build new releases
rpm, deb, etc using
equinox release \
--version="1.0.0" \
--platforms="darwin_amd64 linux_amd64" \
--signing-key=/Users/inconshreveable/equinox.key \
--app="app_ja6WuaZgwsF" \
--to
Hi,
First, awesome that you started using Go! some thoughts inline:
> 1. The sbxs_ prefix is there just because I expect this package to be part
> of a set of related repositories and I wanted to give them some "unity"
> through naming. Arguably a bad idea, I am not sure about it.
>
I have
As you start working with Go, one other thing you may want to add to your
~/.bash_profile (on linux and mac, not sure about others) is
CDPATH=.:$GOPATH/src/code.google.com/p:$GOPATH/src/github.com:$GOPATH/src/bitbucket.org
export CDPATH
so let's say you have $GOPATH as
/home/my-name/work/gol
Hi,
If you don't want to have to copy/paste that snippet of code on a new
laptop/OS install, I have been using:
$ go get github.com/rif/spark
$ spark static_site/
for the last couple of years, works great, it's simple.
https://github.com/rif/spark
Regards,
Diego
On Thursday, September 29, 2
Hi,
>From a 3rd party I get a file with time like 1503 or 900 (meaning 3:03PM
or 9:00 AM)
so I thought I could use this format:
https://play.golang.org/p/RKR71hTWGo
x, err := time.Parse("1504", "900")
but the result is:
2009/11/10 23:00:00 parsing time "900": hour out of range
As a work ar
Thanks for the answers, looks like I'll keep using my work around for the
time being.
Diego
On Wednesday, October 19, 2016 at 1:19:08 PM UTC-4, Kyle Shannon wrote:
>
> Related to:
>
> https://github.com/golang/go/issues/12919
>
> On Tue, Oct 18, 2016 at 9:49 PM
Hi (sorry for the cryptic subject, I'm just not sure what to even call
this):
I think this is not strictly a mgo question, I have this simplified
function that gets documents from a mongo instance using Iter(), I then
loop through the results, append them to a slice []interface{} but the
resu
hat. Remember that bson.M is just interface{} and maps are pointer-
> like.
>
> On Mon, 2016-10-24 at 11:56 -0700, Diego Medina wrote:
> > Hi (sorry for the cryptic subject, I'm just not sure what to even
> > call
> > this):
> >
> >
> > I thi
As a user of a package, if I "start it" by calling Start(), I will most
likely look for a "Stop()" function but calling cancel on the context
wouldn't feel natural because I'm not canceling the server, I would be done
with it and don't need it any more).
Regards,
On Thursday, October 27, 2016
Hi,
> How can i run my tests "go test" for my entire domain model is they are
> in sub folders?
>
If I understood your question, what you are looking for is to run
go test ./...
at the root, that will run tests at the root but also tests in the
subfolders
Regards,
Diego
>
> applica
>
>
> Back on my original question, its ok if i copy paste the code into a
> specific module with its appropriate credits ?
> Given the quick red i gave it, there s really not much to change to this
> code, it if works already.
>
>
at the top of that file it says :
// Use of this source code is
Hi,
it isn't finding the actual binary of your go app. The binary could be in
one of two places,
if you run go install
it goes to
$GOPATH/bin
which is /root/work/bin
if you did go build, it is at the root of your project directory
Hope that helps.
On Tuesday, November 29, 2016 at 1:03:09
Hi,
I have seen similar posts to this but I could not find any of them so
posting this.
I went ahead and installed the latest beta to try it out, both my apps at
work work ok with it (yeah!), but now go-plus in Atom (and the autocomplete
plugin) won't autocomplete any more, it just offers "PAN
In our case, our original product was a web app, written in Scala, as our
data starting growing, we had to move from real time queries to our
database plus some data manipulation to precalculating/storing the data in
a ready to server manner.
This worked well for a while, but eventually our back
> All of our build servers are locked down and cannot reach public
Internet, only our local library mirror.
With this in mind, you could use gvt https://github.com/FiloSottile/gvt
all your devs should use it to fetch dependencies, yes, they would use open
internet, but only while they get their
If you were planning on running each binary on different servers, then it
would somewhat make sense (but you should really measure to see how CPU
heavy the processing is).
But if you are planning on putting both binaries on the same server, you
may as well just have one binary. Otherwise both b
In case anyone else gets to this post but has an ssh-agent running, you can
use this:
import (
"net"
"os"
"golang.org/x/crypto/ssh/agent"
)
if aconn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil {
signerFn := agent.NewClient(aconn).Signers
signers, err := signerFn()
i
Hi,
you were very close, instead of
go install github.com/mortalcatalyst/xml/xml.go
do
go install github.com/mortalcatalyst/xml
In go, you don't install the particular file, you install the program as a
whole (which in many cases, it involves more than one file)
And as a side note, normally
never had to set GOBIN
Thanks
Diego
On Mon, Feb 13, 2017 at 5:39 AM, Sayth Renshaw
wrote:
>
>
> On Sunday, 12 February 2017 04:16:15 UTC+11, Diego Medina wrote:
>>
>> Hi,
>>
>> you were very close, instead of
>>
>> go install github.com/mortal
y its being difficult.
>
> Cheers
>
> Sayth
>
> On Mon, 13 Feb 2017, 11:41 PM Diego Medina wrote:
>
>> Can you include the link to the guide you followed to install Go?
>>
>> I always follow
>> https://golang.org/doc/install#install
>>
>> whic
I wrote this
https://blog.fmpwizard.com/2016/09/30/automatic-tls-certificates-for-your-go-application/
which downloads the certs to a path you specify
there is a complete Go app to show how it all works together
Thanks
Die
On Tuesday, February 14, 2017 at 8:11:51 AM UTC-5, Tieson Molly wrot
Hi,
I think you pasted the same content to test.go as well as second.go
in any case, if you use go run, you need to specify all the files involved:
go run test.go second.go
should do the trick
That being said, unless you are writing small scripts using Go, I would not
recommend doing this, in
The reasons we have for moving our Scala heavy process app to Go are:
1. Much, much smaller memory footprint, both, initial app running and then
loading the same number of items from our database.
2. During development, compilation time.
3. Version upgrades:
As long as you vendor your Go depe
consumed
> in that way. And it is independent of any package directory structure.
>
>
Go is very diff than many other languages, good practices there don't
always translate to Go's good practices, this being one of them.
Thanks
Diego
> Angel "Java" Lopez
>
Hi,
See below:
My first idea was to make some background process, which will scrape rooms
> every 30 seconds, save the results *(in mongo, in cookies or somewhere
> else, advise me please)*, match new scrape results with previous and save
> differences (new rooms) in DB for future posting to
ou and your team get to use Go on this next project.
> On Sat, Feb 18, 2017 at 1:30 PM Diego Medina > wrote:
>
>> The reasons we have for moving our Scala heavy process app to Go are:
>>
>> 1. Much, much smaller memory footprint, both, initial app running and
&g
revent the need for merging in future updates.
>
>
>
> Thanks
>
> Sayth
>
--
Diego Medina
Lift/Scala Consultant
di...@fmpwizard.com
https://blog.fmpwizard.com/
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
be bad for making a standalone
>> program that checks gRPC health endpoints because the binary would be large
>> and the start-up time would be long.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts&
t;*go* ctl.startWatchUserLocation(username, location)
> }
>
> And one more quetion: how can I close specific background
> process(goroutine with infinite loop) when client want to stop tracking
> some location?
> For example, clients sends another http requset, with some flag
Most likely this is your browser that "remembers" that going to one url was
redirecting to the "incorrect" url, and it doesn't even hit your local
server any more. To make sure this is the case, use curl from the command
line with the -v paarameter to see all the headers:
curl -v http://127.0.
Hi,
1. Would help if you could post a link to the challenge/API
2. iric, Facebook uses https://wit.ai/ for their chat bots, and they have
an http API so using regular Go you don't need any sdk/framework
Thanks
On Wednesday, February 22, 2017 at 8:15:19 AM UTC-5, Nyah Check wrote:
>
> Hi Gophers
Hi,
Not recommended, it's better to be explicit by using the full import path,
even if it feels odd at first, other users reading your code will know
exactly where the packages are.
For more info, see the last two replies here
https://groups.google.com/d/topic/golang-nuts/8grbqER8h54/discussion
t;> an http API so using regular Go you don't need any sdk/framework
>>
> Yeah, I saw that. It appears there's a python API not Go. I'll try the
> regular HTTP then.
>
> Thanks,
> Nyah
> --
> "The heaviest penalty for declining to rule is to be ruled
Note that if you write a project that other users would use, you will force
them to update their $GOPATH to make your app work.
Which I think it a lot worse than making people who fork your project
update the import path And like someone else said, if I need to fork a
project, I most likely alre
maps are not thread safe, so when you read/write to them, you need to use a
mutex, see the "concurrency" sections here
https://blog.golang.org/go-maps-in-action
That is a good explanation with code samples.
Thanks
Diego
On Friday, March 3, 2017 at 8:31:12 AM UTC-5, 詹青朋 wrote:
>
> Hey guys,
Something that wasn't too clear to me when I started using Go several years
ago was "where is the .git folder going to end up as part of the GOPATH
path", if this is what you are also wondering, the answer is:
go
--- bin
--- pkg
--- src
--flmain
--flowlogs
--github.com
Like others have said, go with #2, and to help those developers who are new
to Go, provide easy to find (maybe in the README) examples of what to do
when they don't actually have any useful context value to pass. That will
save them time searching around to see what context is, what to use it fo
Hi,
I'm using go/ast (and token/types. etc) to parse a Go project, it all works
well when my program only has one package, but there are times where I have
code like this:
file-a.go
=
package a
...
selector := b.Selector(CompanyID)
...
and then
file-b.go
package b
with it, i had to hide it when i wanted to
> visualize the tree
> I even created a gist,
> https://gist.github.com/mh-cbon/3ed5d9c39e9635cfed0f89698133
> to use in place of https://golang.org/pkg/go/ast/#example_Print
>
> On Monday, April 17, 2017 at 3:45:23 PM UTC+2, Diego Medina
think we can help better if you can uncover,
>
> - "expected package a but found b for file xyz.go"
> - "For now, the information I'm looking for is the Decl value, "
>
> Must be a simple difficulty to fix.
>
> On Monday, April 17, 2017 at 8:29:22 PM UTC+2, D
> Often, this involves incrementing the version [...]
If the process of saying "this binary is good to go, deploy it locally for
use" already involve more than go install, maybe you could also "deploy"
the binary to a different location than $GOPATH/bin . The benefit there is
that you can take
All those sound like good points, but it depending on how technical your
mid/high level management are, you may want to adjust the wording.
if your audience are very technical, go fmt, and not having to read/learn
code style sounds great, if they are not very technical, they will care
less abou
Hi,
Having a default "go" folder inside your home directory is a recent change
(I believe it was introduced in 1.8)
The mac installer may do extra steps, but my guess is that you started
using Go before you set GOPATH to the dropbox folder, a simple
go get
would create the $HOME/go folder
Hi,
3 things:
1. can you post here what you get when you type
echo $GOPATH
just to make sure your GOPATH isn't being updated in some other place you
didn't know about
2. How are you installing a package?
3. can you post what is being placed in /home ?
Thanks
Diego
On Monday, July 3, 201
yes, you provide the storage implementation and the library will use it
when it needs to store/retrieve certs
On Wednesday, July 5, 2017 at 10:48:26 AM UTC-4, Daniel Martí wrote:
>
> Hi all,
>
> One project I contribute to started using rsc.io/letsencrypt years ago.
> Now that it's recommende
Hi,
This doesn't answer your question but usually when I need to profile our
app, I first use expvar to report different internal stats like what the
app is doing (how many records is it walking from the db, any batch
process, etc), send those to datadog (any monitoring works fine) and then I
Hi,
Is there a way to know if a binary has to be rebuilt, due to changes to
some of its dependencies?
Let's say I have a repo with this structure:
/cmd/tool1/main.go
/cmd/tool2/main.go
/pkg/users/update.go
/pkg/math/avg.go
tool1 imports the math package
tool2 imports both, math and user pack
Thanks!
On Monday, September 14, 2020 at 5:02:53 PM UTC-4 Alex wrote:
> Sorry, return values were reversed. "true\n" if it needs rebuilding
>
> On Tuesday, 15 September 2020 at 5:00:23 am UTC+8 Alex wrote:
>
>> You can run the command: *go list -f {{.Stale}}*
>> It will print a "true\n" or "fals
There is only a small change I had to do to get it to encrypt and decrypt:
inside your encryptMessage() func, change:
_, err = encryptorWriter.Write([]byte(message))
//messageReader := bytes.NewReader([]byte(message))
//_, err = io.Copy(encoderWriter, messageReader)
using the Write() method vs
Hi Karan,
>I don't have a background in Java/C#[...]
This is actually good, there is less for you to "unlearn"
If you don't want to pass parameters to create a user, like passing the
userID, name, etc, because it "seems wrong/verbose", then don't worry about
it.
In Go (any I apply this to othe
Hi,
Today I tried the getgo [1] binary but instead of providing Go 1.15.5, it
installed 1.15.4. I looked around the code and ended up in
https://golang.org/VERSION?m=text
which reports 1.15.4 as the latest. Is this the right place to report this
to get it fixed?
[1] https://github.com/golang
great, thanks! Then I'll see about raising an issue/PR with the project
that uses that url.
On Tuesday, November 17, 2020 at 2:09:19 PM UTC-5 seank...@gmail.com wrote:
> VERSION reports the version the site is under, use
> https://golang.org/dl/?mode=json instead
>
> On Tuesday, November 17,
I entered https://github.com/golang/go/issues/42676 and I sent the related
CL
On Tuesday, November 17, 2020 at 2:23:45 PM UTC-5 Diego Medina wrote:
> great, thanks! Then I'll see about raising an issue/PR with the project
> that uses that url.
>
>
>
> On Tuesday, Novem
80 matches
Mail list logo