Re: [go-nuts] MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS Demuxer in pure Go

2022-10-24 Thread Dimas Prawira
Nice Milan, thank you for sharing this.

Regards



On Sun, Oct 23, 2022 at 11:23 PM Milan Nikolic  wrote:

> A simple way to get video playback into your app or game.
> https://github.com/gen2brain/mpeg
>
> There is also a live web example here https://gen2brain.github.io/mpeg.
> The CPU usage is higher than on the desktop but it is still usable.
>
> Interestingly, while TinyGo produced 4x smaller binary, the performance is
> awful. There are large CPU spikes that make it unusable.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/24361c99-e332-4d41-a1bf-3a3d85d584a3n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUftuGxk6%3DOjUgqFZ3dT65HzVpmrM8TC7BLCd3U-Xmo61g%40mail.gmail.com.


Re: [go-nuts] Re: How can I break out of a goroutine if a condition is met?

2021-07-20 Thread Dimas Prawira
I personally like to use range channel to "break out" process in goroutine,
for example :

package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
c := make(chan bool)
wg.Add(1)
go func() {
defer wg.Done()
for b := range c {
fmt.Printf("Hello %t\n", b)
}
}()
c <- true
c <- true
close(c)
wg.Wait()
}

Dave Chenney has great post about this post :
http://dave.cheney.net/2013/04/30/curious-channels.

Hope this helps




On Wed, Jul 21, 2021 at 12:45 AM Brian Candler  wrote:

> Which goroutine panics: the one which got a successful login, or the other
> ones?
>
> If the goroutine which sees a successful login panics, then that's a
> problem with that particular goroutine, and you'll need to debug it in the
> normal way.  Reading the panic message carefully would be a good starting
> point.
>
> Note that you don't "break out" of a goroutine; you can break out of a
> loop.  You can terminate a goroutine simply by returning from the function
> that was invoked by "go "
>
> If you want to terminate the other goroutines, then the standard way to do
> that is to use a Context, and signal the context as "done".  If those
> goroutines are blocked on I/O, they should be modified so that they make
> use of the context too. There is a blog post here
>  you'll find useful.  But it seems to me
> this is a separate problem to the one of the original goroutine throwing a
> panic.
>
> On Tuesday, 20 July 2021 at 17:29:22 UTC+1 Tenjin wrote:
>
>> I am wanting to try and login to mutiple servers at once (bruteforce) now
>> I am spawning a new goroutine for each set of credentials. I want to be
>> able to break out of my loop that I have once a successful login is met, as
>> of right now the program just throws a panic and I am unsure of what I can
>> do.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/f1953fe9-0cef-4f24-bf72-804a078bcb7an%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUdU6K5bf__KnMpKY_HT2uij_D2kBoDLyNTwwAim2SyqBQ%40mail.gmail.com.


Re: [go-nuts] SFTPGo 2.0.0 Released

2021-02-07 Thread Dimas Prawira
Nice..

Best regards

On Sat, Feb 6, 2021, 18:38 Nicola Murino  wrote:

> Hi all,
>
> I'm pleased to announce SFTPGo 2.0.0!
>
> SFTPGo is a fully featured and highly configurable SFTP server with
> optional FTP/S and WebDAV support, written in Go. It can serve local
> filesystem, S3 (compatible) Object Storage, Google Cloud Storage, Azure
> Blob Storage, other SFTP servers.
>
> Here are the main new features compared to 1.2.x versions:
>
> - REST API v2: you can now define administrators and related permissions.
> - Data At Rest Encryption.
> - KMS support: cloud account credentials and other sensitive data can be
> stored within external Key Management Services (Vault, GCP KMS, AWS KMS).
> - SFTP can also be used as storage backend, so you can proxy other SFTP
> servers.
> - Two-Way TLS authentication, aka TLS with client certificate
> authentication, for FTP, WebDAV, REST API, web admin.
> - Multiple binding support for all the supported protocols and REST API.
> - Built-in defender: you can configure an auto-blocking policy for
> offending hosts.
> - Improved FTP support.
> - Several bug fixes and other minor improvements.
>
> You can find the full list of features and the documentation on the
> project page:
>
> https://github.com/drakkan/sftpgo
>
> Binary releases for Linux, macOS and Windows are available:
>
> https://github.com/drakkan/sftpgo/releases
>
> Docker images are available:
>
> https://hub.docker.com/r/drakkan/sftpgo
> https://github.com/users/drakkan/packages/container/package/sftpgo
>
> If you find a bug please open an issue here:
>
> https://github.com/drakkan/sftpgo/issues
>
> If you want to suggest a new feature or have a question, please start a
> new discussion here:
>
> https://github.com/drakkan/sftpgo/discussions
>
> Yours sincerely,
> Nicola
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/bec9dcf0-a2e6-4cc1-834b-f69c7feb334dn%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUcSszVzG4z61s7qGmh4Phbdbk9SN_2dyTDi80pnDeFXLQ%40mail.gmail.com.


Re: [go-nuts] Using Golang to upload and download files in pcloud using cmd

2020-10-26 Thread Dimas Prawira
I think the example given in the repo is run on command line, all you have
to do is customize it using cobra https://github.com/spf13/cobra



On Mon, Oct 26, 2020, 23:27 Bharath Baiju  wrote:

> Hello all,
>
> I am trying to use golang-pcloud  project
> to upload and download files.With this i can upload my files but
> downloading is not working.
>
> Also when using this i can upload small size of files but when it is more
> than 50mb it is taking more time.
>
> Is there any other method by using golang to connect to pcloud in cmd.Can
> anybody help me ?
>
> Regards
> Bharath baiju
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/4b65dd97-0636-4a31-893f-618181a9ac68n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUfzQ%2BpcirNzgkn5CPf6FN0wpM3ZkagiFOawiMQAJH5z4A%40mail.gmail.com.


Re: [go-nuts] Go open source tools

2020-10-23 Thread Dimas Prawira
You can get and learn on their site (if any) or their repository, for
example :

1. golang dep (https://golang.github.io/dep/)
2. glide (https://glide.sh/)

hope that helps

On Fri, Oct 23, 2020 at 11:57 AM durgasomes...@gmail.com <
durgasomeswararao...@gmail.com> wrote:

> Hi Team,
>
> Anyone helps me to get the below information.
> Do we have any reference to get and learn about go open source tools like
> vet and dependency tools?
>
>
> Thanks,
> Durga SomeswaraRao G.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/f5ee7755-99a8-40c7-ba80-17e83c18a481n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUfLkPsd_6ZNWG1_ZZcXJkSe8NRbxk12AEHJLoc9bv-RoA%40mail.gmail.com.


Re: [go-nuts] Debug http calls made using go http client

2020-08-23 Thread Dimas Prawira
There are several tools which you can use to help to inspect,

1. TCPmon, is a java-based tool for inspecting http call in between server
and client. TCPmon also can be used to simulate slow connection.

Work mechanism of TCPmon is as a proxy. So if I describe it as below

[Your apps] ---> [tcpmon] ---> [server]

2. TCPdump, is a linux app which can be use to dump TCP connection in and
out. This can be help to inspect HTTP request / HTTP come to the server.

3. Traceroute
You may want to inspect / trace connection from your server to vendor's
server using traceroute, maybe the problem is in the connection.

Hope that's helpful

On Sat, Aug 22, 2020, 01:59 krishna...@gmail.com 
wrote:

> Hello Gophers,
>
> I am making multiple http calls from my go application to an external
> vendor's http server using the go standard http client. I've set a 10
> second timeout for my context. Everything works fine.
>
> However, I get random timeouts in my application due to these HTTP calls.
> On further investigation, I found that the http calls to the vendor's
> server take longer than 10 seconds.
> During this period of timeouts, the vendor says they've not received any
> HTTP requests. How do I verify that the http requests are made from my app?
> If the requests are made from my app, how can I figure out what's causing
> the delay?
>
> I tried debugging using the HTTP client trace, but couldn't find any
> actionable information. Any suggestions on how to debug/fix this issue ?
>
> Thanks
> - Krishna
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/2d454dda-6670-48ef-85a2-0a42216dcd29n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUckb_ThhNw4%3Dxbz%3D9v0yJEXAX0CbP4CE5x0VziL5hFDSw%40mail.gmail.com.


Re: [go-nuts] [generics] Replace () with <> or other character

2020-06-17 Thread Dimas Prawira
more and more like Java..


BR

On Wed, Jun 17, 2020 at 11:36 PM Charles Crete  wrote:

> Based on the new proposal, having the type parameters as () seems very
> confusing, as now 3 things in a row use ():
> - Type parameters
> - Function parameters/arguments
> - Return tuple
>
> This results in code like (from the draft):
> func Stringify(type T Stringer)(s []T) (ret []string) {
>   for _, v := range s {
> ret = append(ret, v.String())
>   }
>   return ret
> }
>
> Instead, using <> similar to other languages, makes it easier to visual
> parse:
> func Stringify(s []T) (ret []string) {
>   for _, v := range s {
> ret = append(ret, v.String())
>   }
>   return ret
> }
>
> This can also apply to type definitions:
> type Vector []T
>
> To summarize:
> - Having 3 times () in a row makes it confusing to visual parse
> - The type keyword is not necessary
> - Using <> would make it friendly (and easier to recognize)
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CALk%2Bt4a7a6G7komPB_N1ataYTOjKSU556Gp2cHge%2BxnYnoLBig%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUfObHDJe-Siq%3D-Xko%2Bmcire_V2Me-UmcdSOC7SEsu0tsA%40mail.gmail.com.


Re: [go-nuts] SSL socket listener

2020-06-03 Thread Dimas Prawira
Here is an example running server with TLS

package main
import (
"net/http"
"log"
)
func HelloServer(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("This is an example server.\n"))
}
func main() {
http.HandleFunc("/hello", HelloServer)
err := http.ListenAndServeTLS(":443", "server.crt", "server.key", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}


so in http package there is "ListenAndServeTLS" which can be used to run
the server with TLS enabled.

Hope that helps



On Wed, Jun 3, 2020 at 2:20 PM 'Wesley Peng' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> Hello,
>
> How do I program with SSL to make a server listen on specific port which
> accepts SSL transfer only?
>
> Is there any guide for this since I have no experience on SSL socket
> programming.
>
> Thanks.
>
> Wesley Peng
> wesleyp...@aol.com
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/1690752345.1320667.1591168756241%40mail.yahoo.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUenJBMsZHQ-hajr1b7Leq6vGLcAJ%3DJ_vNObj9NNEsV0aw%40mail.gmail.com.


Re: [go-nuts] Getting 410 error from https://sum.golang.org/lookup/github.com for a private github repo

2020-05-18 Thread Dimas Prawira
I think this has issue reported

https://github.com/golang/go/issues/35164

I have face same issue and what I do is to set sumdb off

$export GOSUMDB=off

and then re-gomod.

Hope that help

Regards
Dimas

On Tue, May 19, 2020 at 3:03 AM Dean Schulze 
wrote:

> Go get doesn't work with private servers that don't have a web serve set
> up on them.  So I've switched to a private repo on github.com.  I'm
> getting a 410 error now from some proxy.  Here's the command:
>
> go get  github.com/dwschulze/shippy-service-consignment/proto/consignment
>
> I get this error:
>
> reading
> https://sum.golang.org/lookup/github.com/dwschulze/shippy-service-consignment@v0.0.0-20200518192947-d5972f582c2c:
> 410 Gone
>
>
> Does go get not work with private repos even on a public github?
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/88c7ed73-c1f2-47e0-a03d-0bdfe3a2d6d8%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUd3irUV2agPp0mR%2BPga768qe952F40v6eza7P9usFDmtQ%40mail.gmail.com.


Re: [go-nuts] How to work with multiple environment like dev, test, staging, prod in golang ?

2020-05-18 Thread Dimas Prawira
I am also Java Developer using SpringBoot as my framework, I use three
kinds of application configuration files (dev, staging, production). But in
Go, I / we use Consul  for storing configuration so the configuration file
will be only one. For configuration format I use Yaml format using viper (
https://github.com/spf13/viper).

Hope that help

Regards
Dimas

On Mon, May 18, 2020 at 12:19 AM Shishira Pradhan <
shishirapradhan2...@gmail.com> wrote:

> Hi All,
>
> i'm a java developer, currently working on golang. In springboot, we have
> configuration like port, database etc info are stored in yaml files like
> application-dev.yml,   application-test.yml, application-prod.yml profiles,
> and profile name is passed during running the application to load profile
> specific configuration. I need to understand that how to load/pass profile
> based properties in golang ?
>
> Thanks,
> shishira
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/5aef274e-e418-430c-84c3-f5100a73e2cc%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUewaAAUoAsN2LLomZF2BCAb%2Bm65h%3DJ4uk3n1NTsbe5qfw%40mail.gmail.com.


Re: [go-nuts] [ANN] Golang Oriented to Aspects (goa) v0.0.1 is released!!!

2019-11-25 Thread Dimas Prawira
Nice... #clap

BR


On Tue, Nov 26, 2019, 4:47 AM Iván Corrales Solera <
ivan.corrales.sol...@gmail.com> wrote:

> Hey folks!
>
> I am so happy yo announce the first release of *Goa*. Goa is a library
> that will drive you to the AOP (Aspect Oriented Paradigm) world!
>
> Even though I still have to work hard on this library, I would appreciate
> some feedback for you guys!.
>
> The full documentation can be found here
>
>- Source ode https://github.com/wesovilabs/goa
>- Full documentation http://wesovilabs.github.io/goa
>
>
>
> Thank you so much for your time! and I hope you enjoy it!
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/7b0347e8-e7c1-4dab-afcb-9608573d7d2b%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeMP54Lv636hNE5i4_M4u1JCEsJaW-NFnf%3DgjMGiwGvTw%40mail.gmail.com.


Re: [go-nuts] liteide x36.2 released.

2019-11-12 Thread Dimas Prawira
Getting 400 Bad Request when accessing http://liteide.org



On Sat, Nov 2, 2019, 9:32 PM visualfc  wrote:

> Hi, all.
> LiteIDE X36.2 released!
> This version fix gocode crash bug. Add new image viewer plugins. Folder
> view support multi copy&paste, move to trash. Fix windows floating dock
> widget style.
>
> * LiteIDE Home
>
> * LiteIDE Source code
>
> * Release downloads
>
>
>
> ### 2019.10.30 Ver X36.2
> * LiteIDE
> * add new image viewer plugin
> * folder view support multi copy & paste
> * folder view support move to trash
> * fix gocode crash
> * update uk (Ukrainian) translation, thanks for cl0ne
> * LiteApp
> * fix floating dock widet style
> * add dock widget floating toolbar
> * folder view support multi copy and paste
> * folder view support move to trash action
> * ImageEditor
> * add new image viewer plugin
> * support image viewer and gif video play
> * GolangEdit
> * support go1.13 number literal syntax highlight
> * gotools & gocode
> * fix bad parser crash
>
> --
> Sent from YoMail for Gmail 
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/emc_e99421b82d804a4d8a64233ab621c5aa%40pc.loc
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUdV%2BoGmt5rKBFmEhBuUtuEGEs0%3DyDDG0pyT%3DPWZ7c0-HA%40mail.gmail.com.


Re: [go-nuts] GO Mod (modules) for dummies. Please help.

2019-10-18 Thread Dimas Prawira
Hi, I have reply thread about Go mod. You can search in the mailist history.

Cheers

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUewYZuxOJy7gD-cdg1fT41o%2Be5K1Gngi5amdCfg2z9UeA%40mail.gmail.com.


Re: [go-nuts] [ANN] go-resty v2.1.0 released - Simple HTTP and REST client library

2019-10-11 Thread Dimas Prawira
Thanks, I'll check it out.

Cheers
Dimas

On Sat, Oct 12, 2019 at 4:32 AM Sam Whited  wrote:

> On Fri, Oct 11, 2019, at 21:24, Dimas Prawira wrote:
> > Just test using got get
>
> You appear to be using an old version of Go that doesn't support modules
> or have it turned off or set to auto using the GO111MODULE environment
> variable. If you upgrade to Go 1.13 and make sure GO111MODULE isn't set,
> it should default to being on.
>
> https://github.com/go-resty/resty/blob/v2.0.0/go.mod
>
> —Sam
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeid3NChc0Uc9rB2mGvkujTL%3DYOHnbVg93H5HDC6RfQFw%40mail.gmail.com.


Re: [go-nuts] Problems with windows installation v1.31.1

2019-10-09 Thread Dimas Prawira
Go v1.12.10 still has godoc in the installer package, so if you want it
maybe you can choose previous version.

Best Regards

On Wed, Oct 9, 2019, 11:46 PM Longeri Carlos  wrote:

> Hi,
> I'm new to go. Just installed Go on a windows10 machine, v1.31.1.
>
> Somehow I don't have godoc.exe in the bin file. i also downloaded the zip
> installation file and it also doesn't have it.
>
> Please help.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/9ba6de77-1a4d-4c57-b7e6-dd23b65b0884%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUe9h9wPeLpMA6vUmLC%2Bj2co0oc%3DVPffa1ocgaE7BFoUPA%40mail.gmail.com.


Re: [go-nuts] go module & local package

2019-10-08 Thread Dimas Prawira
Let me define this first modules are collections of packages. In Go 11, I
use go modules  like the
following:

If both packages are in the same project, you could just do the following:
In go.mod:

module github.com/userName/moduleName

and inside your main.go

import "github.com/userName/moduleName/platform"

However, if they are separate modules, i.e different physical paths and you
still want to import local packages without publishing this remotely to
github for example, you could achieve this by using replace directive.

Given the module name github.com/otherModule and platform, as you've called
it, is the only package inside there. In your main module's go.mod add the
following lines:

module github.com/userName/mainModule
require "github.com/userName/otherModule" v0.0.0
replace "github.com/userName/otherModule" v0.0.0 => "local physical
path to the otherModule"

Note: The path should point to the root directory of the module, and can be
absolute or relative.

Inside main.go, to import a specific package like platform from otherModule:

import "github.com/userName/otherModule/platform"

Here's a gentle introduction
 to
Golang Modules

On Wed, Oct 9, 2019, 1:03 PM Henry  wrote:

> Hi,
>
> I am having trouble trying to migrate from gopath to go module. Some of my
> packages reside in my local machine and are not published. So how do you
> get go module to import local-machine packages?
>
> The second question is that do the dependencies need to use go module as
> well?
>
> Do you need to create your go mod project outside of existing gopath?
>
> Thanks.
>
> Henry
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/45e88d7b-9d10-4af5-a153-c27d4edb8956%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUdZ%2B10vFbHSfjWQ48qu9NDRbXQvN%2Bvb89F%3Du1qHUw5qNg%40mail.gmail.com.


Re: [go-nuts] [ANN] Go Server Pages

2019-10-08 Thread Dimas Prawira
Nice work...

Best regards

On Wed, Oct 9, 2019, 12:16 AM Scott Pakin  wrote:

> I'm excited to announce the initial release of
>
> Go Server Pages
>
> Go Server Pages is an Apache module that lets you embed Go code within a
> Web page.  The Go code gets executed dynamically server-side.  Here's a
> quick example:
>
> 
> 
>   
> Test of Go Server Pages
> 
>   
>
>   
> You should https://gosp.pakin.org/";> strings.ToUpper("try Go Server Pages today") ?>!
>   
> 
>
>
> When a page like that is served over the network, the client sees the Go
> code replaced with its output:
>
> …
>
> You should https://gosp.pakin.org/";>TRY GO SERVER PAGES
> TODAY!
>
> …
>
> If you're familiar with PHP, it's a lot like that but using Go as the
> programming language and with more thought given to security in the
> implementation.  Here's where to go for documentation and downloads:
>
> Home page: https://gosp.pakin.org/
> GitHub repo: https://github.com/spakin/gosp
>
>
> Enjoy!
>
> — Scott
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/91706b87-ae51-4476-87ca-2863154c226f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUc5TtgecZ-C-9xgboc6wk4A-EVqL%2BjFXBL_G%3DATBa4PmQ%40mail.gmail.com.


Re: [go-nuts] Golang library for - ORM & Schema Migration

2019-09-28 Thread Dimas Prawira
migrations should not be _rarely_ if you are writing migration scripts
often, that's a big big big big different problem

cheers

On Sat, Sep 28, 2019 at 8:03 PM Lutz Horn  wrote:

> alex.besogo...@gmail.com:
> > But the main issue is that Go SQL interface SUCKS. It's verbose, hard to
> > use and is difficult to integrate with additional tooling (try adding
> > generic tracing support, I dare you!). So often your SQL code is hidden
> > in reams of wrapper code that sets arguments and reads the results.
>
> That's true. In the Java world, few people use the JDBC API directly,
> which has similar flaws. But this does not mean that JPA and Hibernate
> have to be used. Libraries like JDBI[1] exist that provide a much more
> usable API without the necessities of the ORM concept.
>
> Ragarding the "migration" part of the question, in the Java world
> libraries like Flyway[2] allow fine grained control of schema migrations.
>
> For both use cases similar libraires surely exist for Go. But maybe the
> question was about migrating ORM code and the DB schema together. I am
> not aware of any solution that does this.
>
> Lutz
>
> [1] http://jdbi.org/
> [2] https://flywaydb.org/
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/0aab4dd2-374b-1915-b6f7-77089c42733f%40posteo.de
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUc_7GrbtKtvnG%3D%2BXhqQA0GSF0B6_9oJm7WN9iNR7vkX4w%40mail.gmail.com.


Re: [go-nuts] Golang library for - ORM & Schema Migration

2019-09-28 Thread Dimas Prawira
Let me answer that with code

 ORM syntax
db.Where("name = ?", "donald").First(&user)

another ORM syntax

err := o.QueryTable("user").Filter("name", "slene").One(&user)

another ORM syntax

findByUserdAndOrderCreatedAtBetween(String ovoId, Date startDate, Date
endDate, Pageable pgRequest)


does you know what exactly going on with those query if not show the Raw
query with debug ?

most developers don't really care about SQL, because the important thing is
the results come out as desired. But I suggest you should
https://github.com/jinzhu/gorm/issues/2517

if you don't like SQL on stdlib, I can suggest using
https://github.com/xo/xo

and using raw SQL in ORM for me like wasting time.

cheers








On Sat, Sep 28, 2019, 11:50 AM  wrote:

> First, nobody thinks that knowing ORM's query language absolves one from
> knowing SQL.
>
> But the main issue is that Go SQL interface SUCKS. It's verbose, hard to
> use and is difficult to integrate with additional tooling (try adding
> generic tracing support, I dare you!). So often your SQL code is hidden in
> reams of wrapper code that sets arguments and reads the results.
>
> So even simple ORMs that allow mapping of result sets to objects help to
> reduce boilerplate clutter. More advanced ORMs also offer simple type safe
> queries: https://github.com/go-reform/reform
>
> It's still nowhere close to LINQ for C# or http://www.querydsl.com/ for
> Java, but it's getting there.
>
> On Friday, September 27, 2019 at 3:34:59 AM UTC-7, Dimas Prawira wrote:
>>
>> Many Gophers don't like ORM as :
>> 1. ORM introduce an additional layer of abstraction that doesn't
>> accomplish anything.
>> 2. SQL syntax is more or less the same for every database.
>> 3. If you learn an ORM in Java, you will only ever able to use that ORM
>> knowledge in Java. If you learn SQL, you can use that SQL with almost
>> _exactly the same_ with any other database, and in any programming language.
>> 4. ORMs don't save you any time. The number of "lines" of code for an
>> ORM will be more or less the same as the equivalent logic done in SQL.
>>
>> But if still need to use ORM for any reasons, then you can try GORM
>> https://gorm.io/
>>
>> cheers
>>
>> On Fri, Sep 27, 2019 at 4:20 AM b ram  wrote:
>>
>>> Hi,
>>>
>>> Can you pls suggest libs for  ORM & Schema Migration.
>>>
>>> Thanks.
>>>
>>> --
>>> 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 golan...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/CAB9V516cRxPc8xuQcXQyBGXZWenv0o9ned%2BFDq2WmXyhBNm2Sg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/golang-nuts/CAB9V516cRxPc8xuQcXQyBGXZWenv0o9ned%2BFDq2WmXyhBNm2Sg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/92a68ef4-9836-4d1a-8bb5-a73f0ab1d7b8%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/92a68ef4-9836-4d1a-8bb5-a73f0ab1d7b8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeX8aAo6eOxT_fWq%3DuB3Aa8vgRTH7t36ZuK6D1DFdj9yw%40mail.gmail.com.


Re: [go-nuts] Golang library for - ORM & Schema Migration

2019-09-27 Thread Dimas Prawira
if there's something you _don't_ know how to do in SQL, and it seems the
ORM can do it for you, capture the raw SQL the ORM produces
and tell me if it's easier for you to understand the SQL or the random ORM
API. I 100% guarantee you that the raw SQL the ORM produces will be easier
to understand

ie: you could write the same raw SQL too, if you just tried


All i'm suggesting is: try to learn raw SQL — i think you'll be pleasantly
surprised at just how flexible and easy it is
i would also argue that learning SQL is easier than learning a random ORM
syntax. and raw SQL has the benefit that you'll be able to use it again, on
a future project, in a different programming language
while every ORM i've ever seen is 100% bound entirely to only the
programming language it's used in
i've never seen two ORMs with the same API, or even a similar API
but raw SQL stays the same, for now and 50+ years from now


Let me give you an example :

// newSession creates a new session in the database, returning the created

  // session id.
  func (s *server) newSession(remoteAddr string) (int64, error) {
  const sqlstr = `insert into sessions (remote_addr) values ($1)
returning session_id`
  var id int64
  if err := s.db.QueryRow(sqlstr,
cleanRemoteAddr(remoteAddr)).Scan(&id); err != nil {
  return 0, err
  }
  return id, nil
  }

queries are just as simple.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUebx-LZ%2Bj9qTvoDJrL7RCyBrNJ5P6nq0M8YPs3wh_HCEQ%40mail.gmail.com.


Re: [go-nuts] Go Time #100 with Robert Griesemer and myself

2019-09-27 Thread Dimas Prawira
Awesome, have to watch this..

cheers

On Thu, Sep 26, 2019 at 6:14 AM Rob Pike  wrote:

> It's now live: https://changelog.com/gotime/100
> 
>
> -rob
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAOXNBZTRvWnBC%3DCWSZvpyik6X4tTCnUvVsXP9Zs90WULsFub7A%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUdBJh-ARK8dr153kguYfnMC1s25tmVaGvvKRbh20JJrVg%40mail.gmail.com.


Re: [go-nuts] Golang library for - ORM & Schema Migration

2019-09-27 Thread Dimas Prawira
Many Gophers don't like ORM as :
1. ORM introduce an additional layer of abstraction that doesn't accomplish
anything.
2. SQL syntax is more or less the same for every database.
3. If you learn an ORM in Java, you will only ever able to use that ORM
knowledge in Java. If you learn SQL, you can use that SQL with almost
_exactly the same_ with any other database, and in any programming language.
4. ORMs don't save you any time. The number of "lines" of code for an ORM
will be more or less the same as the equivalent logic done in SQL.

But if still need to use ORM for any reasons, then you can try GORM
https://gorm.io/

cheers

On Fri, Sep 27, 2019 at 4:20 AM b ram  wrote:

> Hi,
>
> Can you pls suggest libs for  ORM & Schema Migration.
>
> Thanks.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAB9V516cRxPc8xuQcXQyBGXZWenv0o9ned%2BFDq2WmXyhBNm2Sg%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeNpeCo_RRfb%2BQRVK%3DHHNhfY4_WYo12QeV8AQOfG%2B2KvA%40mail.gmail.com.


Re: [go-nuts] redirecting http to https

2019-09-25 Thread Dimas Prawira
I would rather to use nginx for redirecting from http to https.

On Wed, Sep 25, 2019, 6:37 AM 'Julia Ma' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> Hi all,
> I recently realized that request.URL.Scheme is not the correct field to
> check whether a request is https or not (thank you to this thread
> 
> and other posts on the internet). Once I've determined that the request is
> http, what do I set the request.TLS to to ensure the redirect is https?
> Thanks,
> Julia
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/9a23f15a-e398-4f7d-9a1c-12990f41d136%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUedA2XeKGR8qXS9%3D3Mi53N05XnE9deakpQ%2BCsx9-4LQog%40mail.gmail.com.


Re: [go-nuts] Forking gotk3 not working?

2019-09-24 Thread Dimas Prawira
Maybe this is not the answer for the problem, just want to share about do
'go get-ing' a private repo, first you should do a configuration

Here is the reference :
https://stackoverflow.com/questions/27500861/whats-the-proper-way-to-go-get-a-private-repository


On Tue, Sep 24, 2019, 11:11 PM  wrote:

> Hi! This is perhaps more a question about git than Go but must have
> something to do with go get, too. I tried to fork gotk3 from github on the
> web page (using Fork button), because I need to merge some important 3rd
> party pull requests and the maintainer is no longer active.
>
> However, after creating a fresh fork and without making any changes, if I
> add the repo into an import statement, go get -u fails with the message:
> cannot load github.com/rasteric/gotk3/gtk: zip: not a valid zip file
>
> My fork is at github.com/rasteric/gotk3, the project using it is private.
>
> How is that possible? Shouldn't a fresh fork work exactly like the
> original? Does anyone have an idea what's going wrong?
>
> If I cannot merge those pull requests (for copy&paste in a TextView), I
> can basically scrap the results of half a year of work and say good-bye to
> GTK. It is very frustrating, so I appreciate very much any help.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/1e8e88ba-4d25-4705-bbc0-bbc221c89236%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUd7G3shyETak%2B2BCxCkXfuwvGBdwhJPYDHh54_TFj6SAA%40mail.gmail.com.


Re: [go-nuts] How to perform dynamic unmarsahlling

2019-09-12 Thread Dimas Prawira
Hi Abraham,

To perform dynamic unmarshal, you can use reflect package in Go.

May this reference give help :
https://zenidas.wordpress.com/recipes/dynamic-unmarshalling-in-golang/

Thank you


On Thu, Sep 12, 2019, 3:33 PM  wrote:

> Can anyone help me perform dynamic unmarshalling depending on the type of
> messages received from a diameter client. In the code below, I have to two
> structures which represent two different messages received by a diameter
> server. I would like to modify the current code which unmarshals the
> request to the struct `var req HandleDERRequest` such that the
> unmarshalling is done dynamically either to the `var req HandleDERRequest`
> or `var challreq HandleChallRequest`, depending on the received message
> that matches a particular structure. I have tried to implement with the
> code below but it not working as it should. All the answers are being
> return at the same time and this is not what am expecting.
>
> func HandleDER(settings sm.Settings) diam.HandlerFunc {
>
> // If received AVP messages are of this struct format, Unmarshal
> message to this structure
>
> type HandleDERRequest struct {
> SessionID datatype.UTF8String   `avp:"Session-Id"`
> OriginHostdatatype.DiameterIdentity `avp:"Origin-Host"`
> OriginRealm   datatype.DiameterIdentity
> `avp:"Origin-Realm"`
> DestinationHost   datatype.DiameterIdentity
> `avp:"Destination-Host"`
> DestinationRealm  datatype.DiameterIdentity
> `avp:"Destination-Realm"`
> UserName  datatype.UTF8String   `avp:"User-Name"`
> AuthSessionState  datatype.Enumerated
> `avp:"Auth-Session-State"`
> AuthApplicationID datatype.Unsigned32
> `avp:"Auth-Application-Id"`
> AuthRequestType   datatype.Enumerated
> `avp:"Auth-Request-Type"`
> EAPPayloaddatatype.OctetString  `avp:"EAP-Payload"`
> RATType   datatype.Enumerated   `avp:"RAT-Type"`
> ANID  datatype.UTF8String   `avp:"ANID"`
> }
>
> // If received AVP messages are of this struct format, Unmarshal
> message to this structure
>
> type HandleChallRequest struct {
> SessionIDdatatype.UTF8String   `avp:"Session-Id"`
> OriginHost   datatype.DiameterIdentity `avp:"Origin-Host"`
> OriginRealm  datatype.DiameterIdentity `avp:"Origin-Realm"`
> DestinationHost  datatype.DiameterIdentity
> `avp:"Destination-Host"`
> DestinationRealm datatype.DiameterIdentity
> `avp:"Destination-Realm"`
> EAPPayload   datatype.OctetString  `avp:"EAP-Payload"`
> }
>
> return func(c diam.Conn, m *diam.Message) {
>
> var err error = nil
> var req HandleDERRequest
>
> var code uint32 = diam.Success
> err = m.Unmarshal(&req)
> if err != nil {
> err = fmt.Errorf("Unmarshal failed: %s", err)
> code = diam.UnableToComply
> log.Printf("Invalid DER(%d): %s\n", code, err.Error())
> }
> a := m.Answer(code)
> a.NewAVP(avp.SessionID, avp.Mbit, 0, req.SessionID)
> a.NewAVP(avp.OriginHost, avp.Mbit, 0, req.DestinationHost)
> a.NewAVP(avp.OriginRealm, avp.Mbit, 0, req.DestinationRealm)
> a.NewAVP(avp.OriginStateID, avp.Mbit, 0,
> settings.OriginStateID)
> _, err = AKA_Challenge_Request(settings, c, a)
> if err != nil {
> log.Printf("Failed to send AAA challenge request: %s",
> err.Error())
> }
>
> var challreq HandleChallageRequest
> err = m.Unmarshal(&challreq)
> if err != nil {
> err = fmt.Errorf("Unmarshal failed: %s", err)
> code = diam.UnableToComply
> log.Printf("Invalid DER(%d): %s\n", code, err.Error())
> }
> a = m.Answer(code)
> a.NewAVP(avp.SessionID, avp.Mbit, 0, req.SessionID)
> a.NewAVP(avp.OriginHost, avp.Mbit, 0, req.DestinationHost)
> a.NewAVP(avp.OriginRealm, avp.Mbit, 0, req.DestinationRealm)
> a.NewAVP(avp.OriginStateID, avp.Mbit, 0,
> settings.OriginStateID)
> _, err = AKA_Success_Notification(settings, c, a)
> if err != nil {
>log.Printf("Failed to send Success Notification: %s",
> err.Error())
>}
> }
> }
>
> I know there should be an if condition of the return function but I don't
> know how to start. Please any idea about how to go about it.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discuss

Re: [go-nuts] How Gmail API refreshes token?

2019-09-09 Thread Dimas Prawira
I never use Gmail API, maybe I will do dumb solution,  running the sample
in local and see how it is going on.

On Mon, Sep 9, 2019 at 11:59 AM Grigorii Tkachuk 
wrote:

> I'm looking into this example
> https://github.com/gsuitedevs/go-samples/blob/master/gmail/quickstart/quickstart.go
>  and
> I do not understand why it refreshes "token.json". On line 45 we are
> passing token itself but not a path to token file. I went thru a
> documentation and source code but I do not understand how it works. My goal
> to put service which interacts with gmail api inside k8s cluster and I'm
> searching a way to pass and store token using k8s secrets but in the first
> of all I want to understand how it works with files.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/d3d55244-5d75-464a-86af-8ce5a4eaa09b%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUczNQ9MLB%2B04B3V88B1g2Kmfv3dcud1UMdSV%2Bq834seyQ%40mail.gmail.com.