Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-07-09 Thread Shulhan
Hi Mike, On Thu, 29 Jun 2023 22:04:01 -0700 (PDT) Mike Schinkel wrote: > There are many aspects of this proposal that I really like, and a few > that I think need to be reconsidered. > > In general I like that it: > >1. Does not try to handle errors *above *where the errors > occurred,

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-17 Thread Shulhan
Hi Jan, thanks for response. On Mon, 5 Jun 2023 01:06:37 -0700 (PDT) Jan wrote: > Repeating Justin's consideration: one of my (and from colleagues I > discuss the topic with) major issues with current error handling is > the repetition of identical code. Your proposal still requires `when > err

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-17 Thread Shulhan
Hi Justin, thanks for reviewing, sorry for late response. On Sun, 4 Jun 2023 17:28:29 -0700 (PDT) Justin Israel wrote: > > I don't really understand the comparison between this proposal and > the referenced previous one. If we see one of the first code in the previous proposal design,

Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-06-17 Thread Shulhan
On Sun, 4 Jun 2023 12:36:20 -0700 Ian Lance Taylor wrote: > On Sun, Jun 4, 2023 at 9:17 AM Shulhan wrote: > > > > I have been reading several proposals about error handling couple of > > months ago and today a light bulb come upon me, and then I write as > > much as

[go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-06-04 Thread Shulhan
Dear gophers, I have been reading several proposals about error handling couple of months ago and today a light bulb come upon me, and then I write as much as I can think. I am not sure if its good or bad idea or even possible to implement. In this post, I will try as concise as possible. The

Re: [go-nuts] Short Variable Declarations Are Oversold

2023-04-23 Thread Shulhan
23 Apr 2023 05:31:25 jlfo...@berkeley.edu : > Short definitions detract from one of Go’s primary goals - readability. I > started using Go in the first place because I wanted a strongly typed > language with explicit type declarations.  > > As a result of all this, I’ve started to avoid

Re: [go-nuts] What's go's convention for specifying the equivolent of configure --prefix?

2022-12-01 Thread Shulhan
On Thu, 1 Dec 2022 18:21:37 +0800 Glen Huang wrote: > > Whats wrong with const? > > Const is the ideal choice, but how do users of my program specify the > path when they compile it? > They can't, but in Go, I am leaning to prefer where user can set the "prefix" when running the program

Re: [go-nuts] What's go's convention for specifying the equivolent of configure --prefix?

2022-12-01 Thread Shulhan
On Thu, 1 Dec 2022 01:39:38 -0800 (PST) "hey...@gmail.com" wrote: > I'm writing a command line program in go, and it needs to access some > predefined external files like /usr/lib/name/file. What would be a > good way to allow specify the constant path in compile time? > > I see two options: >

Re: [go-nuts] Proposal for change type Duration int64

2022-11-22 Thread Shulhan
On Tue, 22 Nov 2022 02:28:14 -0800 (PST) Nikhilesh Susarla wrote: > Hi, > > type Duration int64 > > The current Duration is int64 and the duration value should never be > less than 0 else it will panic. It would be safe and advisable to > change it to uint64 or so, where at least it would not

Re: [go-nuts] Detecting JSON changes

2022-10-10 Thread Shulhan
On Mon, 10 Oct 2022 07:50:20 -0700 (PDT) Slawomir Pryczek wrote: > Hi Guys, > I have 2 json files, A, B. Now i want to detect changes on the root > level. > > File A: {"a":{"b":1, "c":2}, "x":false, ... } > File B: {"a":{"b":1, "c":2}, "x":true, ... } > > I want to be able to see that x is

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Shulhan
On Sun, 2 Oct 2022 20:45:08 +1100 Rob Pike wrote: > This is a race in new code, then, so please file an issue at > https://go.dev/issue/new > > -rob > Done, https://github.com/golang/go/issues/56006 Thank you for walking me through this. -- You received this message because you are

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Shulhan
nter.(*CoverageDataWriter).writeCounters() /home/ms/opt/go/src/internal/coverage/encodecounter/encode.go:268 +0x16f ... Found 12 data race(s) FAILgithub.com/shuLhan/share/lib/dns0.754s FAIL BTW, from documentation, the -race flag automatically set the -covermode=atomic. -

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Shulhan
int "no test files" when running go test, $ GOEXPERIMENT=coverageredesign CGO_ENABLED=1 go test -mode=atomic -race -coverprofile=cover.out ./lib/dns ? github.com/shuLhan/share[no test files] Not sure I am using the flag correctly or not since I cannot find it in

[go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Shulhan
/runtime/panic.go:476 +0x32 testing.(*M).Run() /home/ms/opt/go/src/testing/testing.go:1771 +0xbb3 github.com/shuLhan/share/lib/dns.TestMain() /home/ms/go/src/github.com/shuLhan/share/lib/dns/dns_test.go:63 +0x5db main.main() _testmain.go:192 +0x33d Previous write

Re: [go-nuts] Go Fonts v2.010

2022-06-18 Thread Shulhan
Do you know any public CDN for gofont/ttfs? Somethings like fonts.google.com or any. -- { "git":"git.sr.ht/~shulhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscri

Re: [go-nuts] Protective buffered channel that never triggers deadlock

2022-04-13 Thread Shulhan
u.Lock() > defer ch.Mu.Unlock() > > if len(ch.Ch) < cap(ch.Ch){ > ch.Ch <- k > } > } > I believe the idiom way is to use select to check if channel is full or not. See "leaky buffer" section on https://go.dev/doc/effective_g

Re: [go-nuts] Golang JSONObject

2022-01-12 Thread Shulhan
of field start with lowercase it will not exported by json.Marshal(). See https://go.dev/blog/json and https://pkg.go.dev/encoding/json#Marshal for more information. -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message b

Re: [go-nuts] How to deploy the tour website ?

2021-09-27 Thread Shulhan
On Sun, 19 Sep 2021 12:42:42 +0300 mustafa asaad wrote: > Hi, I want to translate the go tour to Arabic I have finished the > first page of the tour and I want to check if everything is good so > when I want to deploy the website to app engine, it's asking me for > money and even when I want to

Re: [go-nuts] go-tour-TH cost

2021-09-27 Thread Shulhan
On Mon, 27 Sep 2021 17:10:16 +0700 Pallat Anchaleechamaikorn wrote: > Dear Gophers, > > I have a question about my contribution go-tour-TH for Thai language > in GCP app engine. > > I'd like to confirm a bit about the cost. > I've seen in the >

Re: [go-nuts] Documentation on golang packages and import syntax

2021-07-11 Thread Shulhan
ave "myproject/mypackage", where "myproject" defined as package "main", then "main/mypackage" is the _import path_ for that package that can be imported by any Go source code under "$HOME/go/src" except by the package itself. -- Shulhan -- Yo

Re: [go-nuts] Understanding how []byte("astring") works

2021-06-14 Thread Shulhan
On Mon, 14 Jun 2021 10:24:00 +1000 Amit Saha wrote: > Hi - My main motivation to understand this is i always had to google > this - how to convert a string to a byte slice. > > Is []byte a type that has been defined in the compiler? > > Or, is that an internal level detail that an earlier

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Shulhan
On Thu, 20 May 2021 07:05:22 -0700 (PDT) Aaron Epstein wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved > this issue. > > Still would be good to know if it is possible to know which gcc go is > using... > As addition to Manlio reply, for more information about using

[go-nuts] Re: error comparison not working on type with field

2021-04-04 Thread Shulhan
On Sun, 4 Apr 2021 20:16:15 +0700 Shulhan wrote: > Hi all, > > I found an error that instantiate with type that have field cannot be > compared with the instance of the same type. Here is the test code, > > > type typeErrorWithoutField struct{

[go-nuts] error comparison not working on type with field

2021-04-04 Thread Shulhan
arget: false errors_test.go:92: errors.Is(err, target): false --- PASS: TestTypeErrorWithPublicField (0.00s) === RUN TestTypeErrorWithIs errors_test.go:101: err == target: false errors_test.go:102: errors.Is(err, target): true --- PASS:

Re: [go-nuts] Data Sharing with Non go application

2021-04-03 Thread Shulhan
On Sat, 3 Apr 2021 03:42:03 -0700 (PDT) R Srinivasan wrote: > In my app, I would like to use golang for a data aggregator > subsystem. Would like a fast and efficient way of sharing this data > with a consumer subsystem developed in C++. (Both running in the same > system). > > Solution I am

Re: [go-nuts] [Macos/Apple M1] HTTP client requests to ".local" domain adds 5 seconds overhead

2021-03-31 Thread Shulhan
On Wed, 31 Mar 2021 01:47:43 -0700 (PDT) Jonathan Hedrén wrote: > I've set up a development environment on my MacBook Pro M1 (running > Big Sur 11.2.3, Go 1.16.2) with a number of small Go/.Net HTTP APIs > that are communication with each other. To replicate our production > infrastructure I've

Re: [go-nuts] Using nested struct to save master-detail POST request

2021-03-21 Thread Shulhan
On Sun, 21 Mar 2021 13:37:18 -0700 (PDT) Hugh Myrie wrote: > I am able to decode the body of a POST request > using json.NewDecoder(r.Body)., then save the result to a database. > > Example: > > type Product struct { > IDint `json:"id"` > Description string `json:"description"` >

Re: [go-nuts] How do you get an update for the tip of a package?

2021-03-19 Thread Shulhan
On Wed, 3 Mar 2021 07:06:36 -0800 (PST) Peter Kleiweg wrote: > I try to install a Go program from github at tip. > > This works: > > go get github.com/some/program@HEAD > > But when there is a new push to the repository, and I do this: > > go get -u github.com/some/program@HEAD > >

Re: [go-nuts] Local mod version

2021-03-19 Thread Shulhan
On Fri, 19 Mar 2021 00:14:40 -0700 (PDT) Pierre Curto wrote: > Hello gophers, > > Trying to locally get the same semver string as if downloading it > from its git repo, and not succeeding. Any pointer? > > Thanks! > This may works or may not works depends on your OS:

Re: [go-nuts] Why GO111MODULE=auto go get does not always work?

2021-02-24 Thread Shulhan
> On 25 Feb 2021, at 01.40, Peng Yu wrote: > > Hi, > > `GO111MODULE=auto go get` does not always work. What causes this bug? Thanks. > > $ GO111MODULE=auto go get golang.org/x/net/html > $ GO111MODULE=auto go get rsc.io/quote > /Users/xxx/go/src/rsc.io/quote/quote.go:8:8: code in directory

Re: [go-nuts] Why can net.Dial be very slow on a hostname defined in /etc/hosts?

2021-02-23 Thread Shulhan
> On 23 Feb 2021, at 12.40, Peng Yu wrote: > > I don’t understand why ping does not have the same problem. Ping is not based > on C library? > Looking at the source code, the ping command on macOS use gethostbyname2() [1][2], while the Go on macOS use C library through getaddrinfo [3][4].

Re: [go-nuts] Why can net.Dial be very slow on a hostname defined in /etc/hosts?

2021-02-22 Thread Shulhan
> On 23 Feb 2021, at 12.11, Peng Yu wrote: > > I tried 1.16. > > $ go version > go version go1.16 darwin/amd64 > > The problem still exists. When I change mymachine.local to > mymachine_local, the problem is gone. So somehow, this is related to > host resolution? It might try to DNS lookup

Re: [go-nuts] Code markup in golang-nuts

2021-02-21 Thread Shulhan
> On 21 Feb 2021, at 14.52, Amnon wrote: > > Slightly off topic. > But is there any way to enhance google groups so that it will support > Markdown? Not that I know of. Google groups is mailing list, any thing in and out would be by/for email clients, which is not specific to Google

Re: [go-nuts] Contributing to golang based project on github - collaboration best practice

2021-02-02 Thread Shulhan
> On 3 Feb 2021, at 10.17, Nicholas Yue wrote: > > Hi, > > I am relatively new to golang coming from a C++/Python world. > > When contributing to C++/Python projects on GitHub, I usually fork the > project, make changes to hit and submit a pull request to the > author/maintainer. > >

Re: [go-nuts] golang memory model?

2021-02-01 Thread Shulhan
> On 1 Feb 2021, at 22.05, xie cui wrote: > > here is the code: > package main > > import "fmt" > > func main() { > counter := 0 > ch := make(chan struct{}, 1) > closeCh := make(chan struct{}) > go func() { > counter++ //(1) > ch <-

Re: [go-nuts] return own custom error from template while it executed

2021-01-15 Thread Shulhan
14 Jan 2021 17:32:37 Vasiliy Tolstov : Hi. I can't find in google how to solve my problem. Inside text/template i want to check some passed data and return some descriptive text if conditions not matching. I don't have ability to check it before template executed. Does it possible? I am

Re: [go-nuts] Linter for checking 'MVS' of go module

2020-12-08 Thread Mhd Shulhan
On Wed, 9 Dec 2020, 11:42 xiangdong...@gmail.com, wrote: > Hi all, > > I'm wondering if any linter, or is it practical to make one, checks > whether a go module's code change conforms the minimal version selection > rules, say linter warns a v2 is needed if incompatible changes to APIs are >

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-26 Thread Shulhan
> On 27 Nov 2020, at 07.06, Afriyie Abraham Kwabena > wrote: > > Hi, > > Am experiencing data race warning with my pollingworker function below even > though when i build with the -race flag i do not get any error. Any help? > Usually when you got data race warning it will print the

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Shulhan
> On 18 Nov 2020, at 01.06, Afriyie Abraham Kwabena > wrote: > > Hi, > > The UpdateData function is the HTTP handler for the route which matches the > URL and is called after the mux.Router after receiving an incoming request > matches the incoming request > against the registered

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Shulhan
Hi Afriyie, Looks like you almost there ;) > On 17 Nov 2020, at 20.11, Afriyie Abraham Kwabena > wrote: > > HI, > > This is what I have tried so far but am not able to get the time difference > in seconds. I mean the time differences between the time stored in the > map[string]time.Time

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-16 Thread Shulhan
> On 16 Nov 2020, at 16.24, Afriyie Abraham Kwabena > wrote: > > Hi , > > You are right but am new to programming and currently this what i have done. > I have an http server handler that receives the PATCH request and stores the > id and the current time stamp of the request. > But my

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-14 Thread Shulhan
> On 14 Nov 2020, at 20.06, Afriyie Abraham Kwabena > wrote: > > Hi, > > My question is about multiple HTTP client polling an HTTP server randomly > with a PATCH request to update a resource at the server running in front of > MongoDB. The clients poll with their different ids and a

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-26 Thread Shulhan
> On 26 Oct 2020, at 10.32, Craig Silverstein wrote: > > > But in my experimenting the overhead of calling `go test` is quite high: > > `go test -count 1 ; go test -count 1 ` is 50% slower than `go > > test -count1 `. > > Oops, I forgot to take parallelism into account. Once I do, it

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-24 Thread Shulhan
test machines, so the client does not need to re-build (file read/write, compile, linking, and so on). -- Shulhan -- 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

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-24 Thread Shulhan
$ go-distributed-test /path/to/go-module Client: GET http:///more_tests Server: pkgA,pkgA/B,pkgC => pkgs Client: FOR EACH pkg in pkgs DO (1) result := "go test "+ $pkg; (2) POST /$pkg/$result DONE On step (1), you can read and store the program exit status with their output (stdout an

Re: [go-nuts] comment conversion script? inlncmt.awk?

2020-10-02 Thread Shulhan
is why I ask. > I am not familiar with inlncmt.awk, did you mean a tools to convert from "/**/" to "//" ? If yes, I have gofmtcomment [1]. [1] https://pkg.go.dev/github.com/shuLhan/share/cmd/gofmtcomment -- You received this message because you are subscribed to the Google

Re: [go-nuts] Running goanalyzer on golang process running inside kubernetes pod

2020-09-11 Thread Mhd Shulhan
Pada tanggal Sab, 12 Sep 2020 08.52, Siddhesh Divekar < siddhesh.dive...@gmail.com> menulis: > In writing to a file option, we would periodically write the file as it > might turn out to be a huge file > for the entire life of the pod to flush at once > Maybe, the obvious solution here is not

Re: [go-nuts] writing to net.Conn tcp socket

2020-09-11 Thread Mhd Shulhan
Pada tanggal Sab, 12 Sep 2020 02.54, Andy Hall menulis: > if I have multiple clients connected to a tcp server and I wish to write > back to specific connections I can record the net.Conn value and then use > the Write method on it...but when using Println I get the following for two >

Re: [go-nuts] The latest version of package in pkg.go.dev

2020-08-15 Thread Shulhan
> On 15 Aug 2020, at 22.50, Tong Sun wrote: > > Oh, thanks. > > The very reason that I do that is to avoid the following situation: > > for i in `jot 12`; do echo $i > f; git commit -am "$i"; git tag v0.0.$i; done > > $ git tag -l > v0.0.1 > v0.0.10 > v0.0.11 > v0.0.12 > v0.0.2 > v0.0.3 >

Re: [go-nuts] How to handle large amount of data on the frontend using go template and cassandraDB?

2020-08-13 Thread Mhd Shulhan
Pada tanggal Kam, 13 Agu 2020 23.21, menulis: > > https://stackoverflow.com/questions/63393803/how-to-handle-large-amount-of-data-on-the-frontend-using-go-template-and-cassand?noredirect=1#comment112097067_63393803 > > I am using *golang* to load data from CassandraDB and send it to the view >

Re: [go-nuts] How url use Html templates?

2020-05-14 Thread Shulhan
> On 14 May 2020, at 23.05, Ali Hassan wrote: > > > Html Templates >{{if .Done}} > > >{{end}} > > My question is this , possible that Url > have string value "/HelloQ/home/" which which show as url link option

Re: [go-nuts] Module versioning on local folder

2020-05-08 Thread Shulhan
> On 8 May 2020, at 14.26, Reyhan Sofian Haqqi wrote: > > The question is why you can't have any version inside the shared libs? How do > you shared the libs locally? > > Because we use monorepo. Maybe git tag works since it's also pointing to a > commit hash? but does it works if we use

Re: [go-nuts] Module versioning on local folder

2020-05-05 Thread Shulhan
> On 6 May 2020, at 11.11, Reyhan Sofian Haqqi wrote: > > Hi, > > I have a case where we developing inside a monorepo project where we > distribute shared libs locally (without publishing) and we're using replace > directive inside go.mod. What we fear is someone changes the shared libs >

[go-nuts] Getting the latest non-tagged version of main module

2020-04-30 Thread Shulhan
before committing any changes to one of dependencies, but one or two things sometimes slip out of our eyes. I have read the documentation on "go help list" and search the web for any alternatives, unfortunately I can't find one. If anyone have any idea about go command that can replace

Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Mhd Shulhan
Pada tanggal Kam, 23 Apr 2020 21.30, Matthew Zimmerman menulis: > I was really confused by this error for ~10 minutes or so. Usually when > this happens to me, I missed a closing/opening brace somewhere or I forgot > to add () after my anonymous function declaration to actually run it. > > This

[go-nuts] Re: go tip: random high CPU usage on VirtualBox

2020-03-14 Thread Mhd Shulhan
Pada tanggal Sab, 14 Mar 2020 06.15, Ian Lance Taylor menulis: > On Fri, Mar 13, 2020 at 1:05 AM Mhd Shulhan wrote: > > > > > > > > > On 12 Mar 2020, at 13.13, Mhd Shulhan wrote: > > > > > > > > >> My question is any one have id

[go-nuts] Re: go tip: random high CPU usage on VirtualBox

2020-03-13 Thread Mhd Shulhan
> On 12 Mar 2020, at 13.13, Mhd Shulhan wrote: > > >> My question is any one have idea how to debug this so I can provide more >> detailed report? >> >> Thank you in advance. > > So, I try to debug with gdb 9.1. Here is the sample of stack when t

[go-nuts] Re: go tip: random high CPU usage on VirtualBox

2020-03-12 Thread Mhd Shulhan
> My question is any one have idea how to debug this so I can provide more > detailed report? > > Thank you in advance. So, I try to debug with gdb 9.1. Here is the sample of stack when the CPU got high, ... [New LWP 1885] [New LWP 1886] [New LWP 1887] [New LWP 1888] [New LWP 1889] ^C

[go-nuts] go tip: random high CPU usage on VirtualBox

2020-03-10 Thread Mhd Shulhan
Hi all, I have Go tip fetch and build every once or more in a week on my local development (office environment). For local testing, I have VirtualBox setup with all third parties. The host machine is macOS Catalina version 10.15.3, Model Identifier: MacBookPro14,1 Processor Name:

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-02-29 Thread Mhd Shulhan
Pada tanggal Min, 1 Mar 2020 01.11, Warren Stephens < wsteph...@prognoshealth.com> menulis: > I often write a function or module to handle some process that takes 3 or > 4 steps to complete. > > After I am happy with the code I then proceed to write tests for the code, > but find that I am

[go-nuts] [Proposal] database/sql: add interface that unite DB and Tx

2020-01-15 Thread Mhd Shulhan
## Problem At some point we have a function that receive an instance of database connection to query rows in specific table. Let's say that function F() accept DB that query table T. If function F() called with DB instance, it will query only rows that has been committed into database. IF

Re: [go-nuts] http: superfluous response.WriteHeader call

2019-11-01 Thread Mhd Shulhan
make sure its only call once. -- shuLhan > -- 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 dis

Re: [go-nuts] How to kill running function from core golang libraries

2019-11-01 Thread Mhd Shulhan
can use a combination of defer, panic and recover to unroll the process. The recover function is inside calculate, and the for-loop is running in goroutine before calculate. defer func() { recover() } go loop() calculate() Inside the loop() you will call panic("terminate").

Re: [go-nuts] How to mock functions in Go ?

2019-09-20 Thread Mhd Shulhan
On Fri, 20 Sep 2019, 18:58 Nitish Saboo, wrote: > Tried running you code, it's failing: > > --- FAIL: TestF (0.00s) > test.go:43: got ubuntu, want testing > FAIL > If that's the case I think you should learn about programming in general first, before learning how to mock a function. I

Re: [go-nuts] How to mock functions in Go ?

2019-09-20 Thread Mhd Shulhan
> On 20 Sep 2019, at 17.21, Nitish Saboo wrote: > > I have a function in Go that I want to unit test but that function contains > os.Hostname().Hence i thought of mocking os.Hostname. > > Example: > > func F(){ > hostname, _ := os.Hostname() > } > > I tried something like this: > > var

Re: [go-nuts] Is there a preferred REDIS driver or go psckage?

2019-09-09 Thread Mhd Shulhan
In the following redis page: https://redis.io/clients#go you can see list of Go packages, the recommended ones are marked with star; while package with smile icon mark packages that have activities within last six months. -- You received this message because you are subscribed to the Google

Re: [go-nuts] Broken links on some blogs

2019-08-18 Thread Mhd Shulhan
On Sun, 18 Aug 2019, 06:04 Ian Lance Taylor, wrote: > On Tue, Aug 13, 2019 at 11:13 AM Shulhan wrote: > > > > I am not sure where or how to report this problem, but all of the links > > from the following blog > > > > https://blog.golang.org/upcoming-google-io

[go-nuts] Broken links on some blogs

2019-08-13 Thread Shulhan
* http://code.google.com/events/io/2010/sessions/go-programming.html * http://code.google.com/events/io/2010/officehours.html There are probably other links in other posts that also broken. Let me known if I should open an issue and/or check other links. -- { "github":"git

Re: [go-nuts] How to mock functions in Go ?

2019-08-01 Thread Shulhan
name = os.Hostname and in test file, getHostname = func() { return "something", nil // or a variable } -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google

Re: [go-nuts] Some issues with UDP and Go

2019-04-06 Thread Mhd Shulhan
On Sun, 7 Apr 2019, 04:24 John Dreystadt, wrote: > I wrote some sample code (at the end of this message) to see how UDP > worked in the Go environment. And I wound up with some issues because > things did not seem to work as I expected. I am running go1.11.2 on both a > Windows box and a Ubuntu

[go-nuts] The aggresiveness of Go module

2019-03-30 Thread Shulhan
- and so on. Well, if I am the student, I will ask `What is "go mod"`?, and then instead of practicing programming, we take time to learn the ecosystem of Go. Is this the goal of Go? What do you think? -- { "github":"github.com/shuLhan", "site":"kilab

Re: [go-nuts] How to lower listen backlog for tcp socket

2019-03-22 Thread Shulhan
On Thu, 21 Mar 2019 23:18:34 +0800 Wangbo wrote: > I try to use net.ListenConfig, but fail > can someone give example ? > What do you mean by fail? What have you try? Have you tried using syscall.Listen [1] ? [1] https://golang.org/pkg/syscall/#Listen -- { "github":

[go-nuts] [ANN] rescached: resolver (DNS) cache daemon

2019-03-22 Thread Shulhan
`/etc/rescached/master.d` - Integration with openresolv - Support DNS over HTTPS (DoH) (draft 14) For more information see https://github.com/shuLhan/rescached-go . = Background The original rescached software is written in C++ [1], written back since 2009. Over time, the more feature to add

Re: [go-nuts] Deferring a close that can fail

2019-03-19 Thread Shulhan
e: either you remove the panic when Close is error (only logging it) or call Close only if Open is success. I usually prefer the latter. -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Shulhan
On Mon, 11 Mar 2019 14:11:32 +0100 Reto Brunner wrote: > On Mon, Mar 11, 2019 at 07:46:27PM +0700, Shulhan wrote: > > I like to read email before sleep, keeping up-to-date with recent > > discussion and what not. > > How are you able to cope with mailing lists? &

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Shulhan
ing very well. > So in short: get used to it :) > Most of the time, I get used to it. -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: url.parse issue if the first character of a url is a number

2019-02-12 Thread Shulhan
ny one label is limited to between 1 and 63 octets. A full domain name is limited to 255 octets (including the separators). [1] https://tools.ietf.org/html/rfc1123#page-13 [2] https://tools.ietf.org/html/rfc2181#section-11 -- { "github":"github.com/shuLhan", "sit

Re: [go-nuts] Contributors wanted: Quantitative performance improvement study

2019-02-01 Thread Shulhan
ion=intro=ph=plaintext -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- 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

Re: [go-nuts] How to write unit test for init()?

2018-11-26 Thread Mhd Shulhan
On Tue, 27 Nov 2018, 11:08 Vast Peng > > when importing *component*, Golang will call *init() *automatically. > One way to do it is by moving the init into another function and call it from init. That way you can create test for the function. > -- You received this message because you are

Re: [go-nuts] At runtime, tell if a package path belongs to stdlib ?

2018-11-26 Thread Shulhan
get list of packages under $GOROOT/src. [1] [1] https://github.com/shuLhan/beku/blob/master/env.go#L398 -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] Using git-codereview with GitHub

2018-11-22 Thread Shulhan
a local > branch). > I think that can be solved with an instruction on how one should create a PR, and mostly a PR is per single commit. I rarely see, many commits in PR except in internal/private repository. -- { "github":"github.com/shuLhan", "site"

Re: [go-nuts] Using git-codereview with GitHub

2018-11-21 Thread Shulhan
ome PR-specific branches etc. > There is hub [1]. If you have not heard it, its work by repo-branch-commits, - create a branch or fork - commit and push to that branch - run `hub pull-request --base --head ` [1] https://github.com/github/hub PS: It was written in Go. -- { "gith

Re: [go-nuts] spanish tour.golang.org is down

2018-10-17 Thread Shulhan
//docs.google.com/document/d/1r6qYP9xey-u0vKXD8xxNaTWn-f_0WI1CtoDm0trx8ZQ/edit -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Modules + go get

2018-09-10 Thread Mhd Shulhan
On Mon, 10 Sep 2018, 16:00 Paul Jolly, wrote: > > GO111MODULE=off go get -u github.com/my/package > Last time I check, if GOPATH is unset and GO111MODULE is on it will download the source code to $HOME/go. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-06 Thread Mhd Shulhan
> > Why on earth keep on ascii? > > IPA: ʅ ʧ ʭ (0x285, 0x2a7, 0x2ad) > Latin-E: « » ¦ > Latin-A: Ħ ŧ Ŧ Ɏ > Latin-B: ǁ ǂ > Probably because its hard to type on most non ASCII keyboard. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Listen by multiple goroutines via channels

2018-09-03 Thread Shulhan
nge notif { for _, ch := range chanClients { ch <- n } } } -- { "github":"github.com/shuLhan", "site":"kilabit.info" } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

Re: [go-nuts] What am I missing here? FYI, I'm completely new to golang xD

2018-09-03 Thread Mhd Shulhan
On Mon, 3 Sep 2018, 13:03 'sebastian andersen' via golang-nuts, < golang-nuts@googlegroups.com> wrote: > This code want's me to believe that I have not declared any of the > variables that I am currently trying to declare: > > func deleteRow() { > db, err := sql.Open("mysql",

Re: [go-nuts] Listen by multiple goroutines via channels

2018-09-03 Thread Mhd Shulhan
On Mon, 3 Sep 2018, 13:03 , wrote: > I have a postgresql notification listener. > > And i have thousands of different goroutines. > > I am waiting to receive a single notification from each goroutine. > > > But only one channel is getting the value. Example: >

Re: [go-nuts] Re: How to setup your development environment using Go modules

2018-08-31 Thread Shulhan
go.mod file to > reference the copy of your library Pkg on disk, e.g. > > replace github.com/author/package => ..//package > This method does not work if someone clone the application repository manually using VCS. I am not sure is this by design or an issue. For example, here

Re: [go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-20 Thread Shulhan
On Sun, 19 Aug 2018 16:13:00 -0700 (PDT) Dave Cheney wrote: > Point of clarification, the package name doesn’t contain a dot, that > is not permitted by the syntax of the package declaration. The name > of the directory you placed the file in ends in .go and this is > confusing the tool. >

[go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-19 Thread Shulhan
Running "go tool cover" on package name contains dot with Go 1.11rc1 or latest dev on branch master return an error, but success on Go 1.10.3. Steps to reproduces - Create package name with dot ('.'). - Create minimal test file - Generate test coverage profile, go test -count=1

[go-nuts] [ANN] HAProxy log miner and forwarder

2018-04-04 Thread Shulhan
Hi all, I just like want to share a library and program written in Go to parse and forward HAProxy (UDP) stream log to Influxdb. https://github.com/shuLhan/haminer Have a nice day. -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] Possible bug on os.Stat and mode is symlink

2017-12-25 Thread Shulhan
Environment OS: Linux xenom-bubu 4.14.8-1-ARCH #1 SMP PREEMPT Wed Dec 20 21:27:44 UTC 2017 x86_64 GNU/Linux Go: go1.10beta1 linux/amd64 Steps to reproduce $ mkdir testSymlink $ cd testSymlink $ touch test $ ln -s test link $ cd .. $ test -L testSymlink/link # true, exit status 0

[go-nuts] Possible bug on os.Stat and mode is symlink

2017-12-25 Thread Shulhan
Environment OS: Linux xenom-bubu 4.14.8-1-ARCH #1 SMP PREEMPT Wed Dec 20 21:27:44 UTC 2017 x86_64 GNU/Linux Go: - go1.10beta1 linux/amd64 - go1.9.2 Steps to reproduce $ mkdir testSymlink $ cd testSymlink $ touch test $ ln -s test link $ cd .. $ test -L testSymlink/link # true,

Re: [go-nuts] [ANN] gometalinter v2.0.0 released - much faster linting

2017-12-05 Thread Shulhan
nter/releases/tag/v2.0.0 > On behalf of my team, I would like to say thank you for this project and to the maintainer of linter tools. Regards, Shulhan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] acme, letsencrypt and different HTTPS ports

2017-11-17 Thread Shulhan
+-+ (1) +---+ | internet | <===> | proxy | <> | api1:9001 | +--+ +-++---+ ^^ || +---+ +> | api2:9002 |

Re: [go-nuts] Multiple Goroutine timeout

2017-10-25 Thread Shulhan
On Wed, 25 Oct 2017 06:30:09 -0700 (PDT) desaiabhi...@gmail.com wrote: > I am expecting to show url1 (2 sec ), url2 (4 sec ) but not url3( 6 > sec) where timeout is 5 sec > > but program showing only url1 value > > Please help > > https://play.golang.org/p/aMOoSEHjmZ > > Thanks in advance >

Re: [go-nuts] cannot assign 1 values to 2 variables [simple error handling]

2017-09-18 Thread Mhd Shulhan
On 18/09/17 10:00, Ângelo Chida wrote: Hi, I'm new in Golang but I'm PHP StackDev since 10 years ago I'm following this tutorial https://golang.org/doc/articles/wiki/ on how to build a web app, but I'm stuck on some error and can't find anywhere a solution. If you read down into "Data

[go-nuts] [ANN] j2p: A tool to help migrating from JIRA to Phabricator

2016-09-01 Thread Shulhan
-task (subtask will be created as task) If someone need and want to expand it, you can get the source code here: https://github.com/shuLhan/j2p -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: flag: Stack overflow when return stringer with fmt.Sprint

2016-09-01 Thread Muhammad Shulhan
On Thursday, 1 September 2016 16:25:24 UTC+7, dja...@gmail.com wrote: > > Hi, > Do you know what infinite recursion is ? > Yes, I know. > fmt.String use your String method > > see https://play.golang.org/p/jeOilZW7JU > > By that logic, the first example should be stack overflow too, but it's

  1   2   >