[go-nuts] Re: Interesting public commentary on Go...

2019-05-28 Thread Slawomir Pryczek
Come on, open your minds a little. Once every 5 years it doesn't hurt to 
learn some new, better ways of doing things. And if someone wants to write 
java code untill he dies, then there's a great method of doing that called 
"stick to java" ;)

That same kind of thinking already marginalized nodejs. The code written in 
it is horrible because almost everyone is trying to emulate c++ and java 
instead of taking one week to learn the language a bit and JS is so 
flexible you can actually do that to some extent. Not sure why some people 
think that every language on the planet needs to be a bad clone of c++ or 
java probably putting "java" in its name doesn't help. Thanks GOD it's 
golang, not go++, we'd be doomed.

Seriously. For me - against generics because of amount of complexity and 
issues it'd introduce into the language. Would be cool to see a fork 
implementing it because maybe it can be done "nicely", however i doubt 
it... It brings to mind Rust's multithreading paradigms. That's actually 
great stuff...  but totally unfit for integrating with golang (for this im 
preety sure). Hopefully, if generics will be implemented it won't be 
integrated too tightly so i won't have to get back to writing code which is 
more jav'ish that it needs to be. Because, that's a crazy idea... if i 
liked how java works more i'd just use java ;) And introducing operator 
overloading into this beautiful design will be like putting readability 
back into medieval ages...

-- 
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/d0ab80ae-ad07-43e3-9a87-32a61940c639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] How does proxy.golang.org discover modules to index?

2019-05-28 Thread Hyang-Ah Hana Kim
Hi -
The index includes the module/version that the proxy.golang.org ever
successfully served.
Go commands with GOPROXY=https://proxy.golang.org env var will fetch the
specified module/version through the proxy and cause the proxy to learn
about them.
As long as the hosting sites are publicly accessible and follow the remote
import path protocol (https://golang.org/cmd/go/#hdr-Remote_import_paths)
the go module mirror can access the data and the index.golang.org will list
them in the result.
The fastest way to teach the proxy and index about your module version is
to run 'GOPROXY=https://proxy.golang.org go get module@version'.


On Sat, May 25, 2019 at 10:27 PM Russtopia  wrote:

> Perhaps a dumb question and if so I apologize in advance. Reading the
> page at https://proxy.golang.org/ I'm unclear as to how the index is
> being populated. Is there an API to submit modules to the index, or is
> it curated by real humans, and what is the process if so, etc.
>
> Does one have to host one's modules at a 'blessed' site to make it
> into this new index? I see big players like github.com, golang.org,
> but other non-corporate domains as well, in
> https://index.golang.org/index
>
> -R.
>
> --
> 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/CAN4yCu82S2nFEgnZKEEbu2naZeX5Z8XvZ%2B2fYjNVmbTAC1v3kg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__

-- 
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/CAM7qfQ%2By1P08bFKX2rptBMmMQbnrH%3DQji2Z50u03UNayj%2BnUsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-28 Thread Wojciech S. Czarnecki
On Tue, 28 May 2019 10:41:03 -0700 (PDT)
Steven Estes  wrote:

> ... anybody else reading this) have any other thoughts on what I can try

> since GODEBUG="cgocheck=2" did not show anything? Nor (in summary) 
> has -msan, -race or the memory sanity debugging built into our C code.
> We're kinda stuck at this point.

On Wed, 22 May 2019 15:16:11 -0700 (PDT)
Steven Estes  wrote:

> With the Golang wrapper, we have run into a variety of panics and crashes 
> that take several forms. Those forms in order of frequency are as follows:

>- Panics due to “sweep increased allocation count”.
>- Panics due to invalid address (bad pointer) in Go heap.
>- SIG-11 failures in various places usually dealing with garbage 
> collection.
>- Panics due to “unknown return address” when trying to return from 
> functions.
>- Mutex deadlocks (everyone waiting and nobody holding)

Its a telltale of corrupt memory (I haven't yet seen Go corrupting C side).
Likely C code happily writes to the address that was freed at Go space.

> Running with either of the options “-msan” or “-race” has not 

Neither can help with C process gone wild. It is the Go code instrumented,
and msan just informs common (C/LLVM) sanitizer about Go writes and reads
(both of Go code usually does within its own boundaries). 


> A bit of background:
> 
[...]
> we make use of Finalizers when the C storage is allocated so when the base
> Golang structure is garbage collected, a function is run that releases the 
> allocated C memory attached to it. So far so good.

No. It is not good. Please read carefully:

https://golang.org/pkg/runtime/#SetFinalizer

paying high attention to phrases starting with  "It is not guaranteed..."

> The C API that we are wrapping has parameters that are pointers to 
> structures that themselves contain pointers to information...

[...] hundreds of lines of description from OP cut [...]

> Anyway, any insights as to how to make progress with this issue would be 
> most appreciated. I’ve tried to keep this as brief as possible.

>From this brief I understood it all was supposed to be "super fast" but after
reading https://docs.yottadb.com/MultiLangProgGuide/cprogram.html I am not
so sure. So I can not offer anything above Michael Jones' advice:
**separate memory concerns with shims**: 

>MJ Michael Jones  wrote:
>MJ and when you change that "pass a pointer" to "have a shim c-side function
>MJ return a uint32 that you just assign on the Go side


> We don’t  understand what the Golang errors are telling us.

They tells a tale of corrupt memory. C side probably is writing to the
locations Go already moved, freed and even assigned to some other
data structure. [Less probable but still possible is corruption due to
"unsafe" fiddling made wrong.]

You apparently have assumed that if something is called Finalizer it will run. 
It more often will not (and not only in Go[1]). Because of that, alas,
I'd suggest to rethink architecture then start anew. (Shredding all code
made on wrong assumptions and starting it anew is way cheaper man-hour
wise than refurbishing then debugging for leftovers.)

[1] https://hownot2code.com/2016/10/07/why-using-finalizers-is-a-bad-idea/

> Steve

Hope this helps.

-- 
Wojciech S. Czarnecki
 << ^oo^ >> OHIR-RIPE

-- 
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/20190528225513.56a014e4%40zuzia.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Interesting public commentary on Go...

2019-05-28 Thread Matt Farina
Russ,

I'm happy you updated the public docs on the proposal review process. It is 
much more clear now. Thanks.

Thanks for publicly listing the people on the review process. It helps 
people have insights. And, thanks for listing Peter who is not on that 
GitHub team. He's a Googler I didn't realize was helping with the reviews.

I wonder, would it make sense to document this list of people in the 
proposal review process? Call it my over-documentation bias that I've 
gotten from CNCF projects. Where the people who own something are 
documented.

- Matt

-- 
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/af37f0f7-74b6-496c-952a-600cdfded3f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Interesting public commentary on Go...

2019-05-28 Thread Russ Cox
Hi all,

I spent a while trying to work out what I want to say about the general
theme of Go and open source, but in the end I realized that my talk at
Gophercon 2015 is a better articulation of what open source means for Go,
and what Google's role is, than any email I can write in a few hours today.
You can read the blog post version, “Go, Open Source, Community,” at
https://blog.golang.org/open-source, and I am including a copy below. I
reread it this morning, and I still believe everything I said then. One
thing I talked about was how we try to focus on building a shared
foundation for Go developers to build tools and programs that interoperate.
A recent example of our continued focus on that theme is how the module
proxy protocol enabled not just the Go module mirror
 but also the Athens project
 and JFrog GoCenter.
 The new go/packages
API  and gopls
 are smaller examples. In fact
there is now a roughly biweekly “Go tools” meeting which is typically
attended by more tool and editor integration authors from outside Google
than from inside Google and organized by a contributor outside Google. (If
you want to know more about that, email Paul Jolly, p...@myitcv.io.)

Community participation is critical to improving Go. We can't make Go the
best language it can be for as many users as possible (staying true to the
original vision of Go) if we don't hear from users about what problems they
are encountering. And good ideas come from outside Google as often as they
come from inside Google. We work with people offering solutions, when they
are interested, to revise and iterate on those solutions to lead to ones
that are as simple as possible and fit well into the overall design of Go.
But getting to yes on every suggested new *feature* is not and never has
been a goal. See the talk for more about our approach.

I've noticed that people often use the term “the Go community” without
being particularly clear about what they mean. To me, the Go community is
all Go users, which is at least a million people
 at this point. As such, it's at
the very least imprecise to say things like “the Go community wants (or
did) X.” Some subset of the Go community wants or did X. No one can speak
for the entire Go community: it is large, it contains multitudes. As best
we can, we try to hear all the many different perspectives of the Go
community. We encourage bug reports and experience reports, and we run the
annual Go user survey, and we hang out here on golang-nuts and on gophers
slack precisely because all those mechanisms help us hear you better. We
try to listen not just to the feature requests but the underlying problems
people are having, and we try, as I said in the Gophercon talk, to find the
small number of changes that solve 90% of the problems instead of the much
more complex solution that gets to 99%. We try to add as little as possible
to solve as much as possible.

In short, we aim to listen to everyone's problems and address as many of
them as possible, but at the same time we don't aim to accept everyone's
offered solutions. Instead we aim to create space for thoughtful
discussions about the offered solutions and revisions to them, and to work
toward a consensus about how to move forward.

At the start of the Go project we were only trying to build the language we
wanted to use in our own work. Since the open source release we have been
actively working to make Go something as many people as possible can use
productively and effectively for their own work. Again, community
involvement is critical for both understanding how well Go is working and
for finding new, concrete ideas about how to make it better. We launched
with clear instructions about how to contribute code, but without clear
instructions about how to contribute ideas. Gophercon 2015 started with my
talk and ended with Andrew Gerrand's talk “How Go was Made
,” which introduced the
proposal process .

As a bit of an update on the proposal process since the 2015 kickoff, it is
essentially unchanged since the start. The “proposal review” group meets
roughly weekly to review proposal issues and make sure the process is
working. We handle trivial yes and trivial no answers, but our primary job
is to shepherd suggested proposals, bring in the necessary voices, and make
sure discussions are proceeding constructively. We have talked in the past
about whether to explicitly look for people outside Google to sit in our
weekly meeting, but if that's really important, then we are not doing our
job right. Again, our primary job is to make sure the issues get
appropriate discussion *on the issue tracker*, where 

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-28 Thread Steven Estes
Ian,

Did you (or anybody else reading this) have any other thoughts on what I 
can try since GODEBUG="cgocheck=2" did not show anything? Nor (in summary) 
has -msan, -race or the memory sanity debugging built into our C code. 
We're kinda stuck at this point.

Steve

-- 
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/f9d35912-6046-4ab4-a30e-b6530bf6486f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Interesting public commentary on Go...

2019-05-28 Thread Matt Farina
Thanks for the details, Russ.

On Tuesday, May 28, 2019 at 11:53:09 AM UTC-4, Russ Cox wrote:
>
> On Mon, May 27, 2019 at 7:08 PM Matt Farina  > wrote:
>
>> 1) when a company runs a project without much publicly documented process 
>> but does as they choose, isn't that a sign of a company run project?
>> 2) The go team at Google has had processes that are not public. One 
>> example is the proposal review process. There has long been a group at 
>> Google that decides these. For a long time this wasn't documented publicly 
>> but happened. The public documentation on it came after the decision on go 
>> modules.
>>
>
> This is demonstrably false. We launched the proposal process at Gophercon 
> in 2015 , well 
> before modules. We did it explicitly to open the process of contributing 
> ideas - as opposed to code - and make it more accessible to new 
> contributors. You can see the full commit history 
> 
>  
> of the process description online. I tried to streamline the doc to make it 
> more approachable in 2018, but I did not make semantic changes in that edit.
>

Let me be a little more clear. In the docs (see the version prior to the 
2018 update at 
https://github.com/golang/proposal/tree/a16a937b3b39c4c42f063842407c30c4c451b524#process)
 
there was no documentation on the proposal reviewers on the Go team. How 
proposals were reviewed was not *documented*. Numerous people, myself 
included, found this by seeing comments on issues that referred to this 
group. Saying something in a speech at a Gothercon is not documentation. 
People who were not paying attention, were not there, or forgot we also not 
able to come upon this information.

This is why I referred to it not being documented publicly.
 

>
> 3) how has no one outside of Google qualified for the core team and why 
>> aren't more companies who are heavy users in on owning it? 
>>
>
> It's unclear what you mean by "core team." If you mean the set of people 
> who can approve (+2) and submit code changes, then as Ian said, there are 
> more people outside Google than inside Google at this point.
>

I think this highlights a documentation gap or place where people have 
different understandings. Is the organizational hierarchy of Go documented 
somewhere? Lots of phrases are thrown around and different people can throw 
different meanings on them. When I refer to that group I'm thinking of 
things like the Kubernetes Steering Committee. It is the core set of people 
responsible for the decisions on the project. This is a smaller group than 
the committers. It is the decision/direction makers for the project.

This group, as far as I'm aware, is all Googlers. It may not be documented 
and there may be assumptions. This is what I expect from a company run 
project.
 

>
> On Mon, May 27, 2019 at 9:17 PM Matt Farina  > wrote:
>
>> As a concrete example: Cloudflare pretty heavily uses Go. When a 
>>> cloudflare-employee started stepping up to work more and more on the Go 
>>> crypto stack, they got hired by Google to do it fulltime. At least from the 
>>> outside, that seems to what happened with Filippo Valsorda.
>>>
>>
>> That's fantastic. This shows some open source in action. It also 
>> highlights that this isn't open governance. If it did, Filippo joining the 
>> core team would have been a separate event from joining Google.
>>
>
> We did give Filippo the ability to +2 (review, approve, and submit) crypto 
> CLs while he was still at Cloudflare, so in that sense it *was* a 
> separate event. Filippo being at Google now means that working directly on 
> Go can be his full-time job now. My understanding is that he had 
> responsibilities at Cloudflare beyond contributing to the Go project.
>
> A better example might be the various engineers who work at companies like 
> Intel, ARM, and Microsoft on Go support for those companies' processors and 
> operating systems. Many of them can now +2 code change as well, and they do 
> so within their area of expertise.
>

Thanks for sharing the additional detail. This has more do to with 
ownership than reviewer/approver status.


I want to make something clear, I'm not suggesting Go change it's 
governance in any of these messages. I'm only attempting to provide 
evidence that Go is a Google owned project. Many open source projects are 
company owned. I use a bunch of them. I'll let other people have a debate 
on how things *should be.*

-- 
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/55d512bb-5afd-4487-9a5c-cc9f48ba683d%40googlegroups.com.
For 

[go-nuts] Re: Interesting public commentary on Go...

2019-05-28 Thread Amnon Baron Cohen
If it aint broke, don't fix it.

On Thursday, 23 May 2019 14:18:25 UTC+1, lgo...@gmail.com wrote:
>
> https://utcc.utoronto.ca/~cks/space/blog/programming/GoIsGooglesLanguage
>

-- 
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/f8e2cb1d-4067-48b9-bd51-c95c4bf731ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Interesting public commentary on Go...

2019-05-28 Thread Russ Cox
On Mon, May 27, 2019 at 7:08 PM Matt Farina  wrote:

> 1) when a company runs a project without much publicly documented process
> but does as they choose, isn't that a sign of a company run project?
> 2) The go team at Google has had processes that are not public. One
> example is the proposal review process. There has long been a group at
> Google that decides these. For a long time this wasn't documented publicly
> but happened. The public documentation on it came after the decision on go
> modules.
>

This is demonstrably false. We launched the proposal process at Gophercon
in 2015 , well before
modules. We did it explicitly to open the process of contributing ideas -
as opposed to code - and make it more accessible to new contributors. You
can see the full commit history
 of the
process description online. I tried to streamline the doc to make it more
approachable in 2018, but I did not make semantic changes in that edit.

3) how has no one outside of Google qualified for the core team and why
> aren't more companies who are heavy users in on owning it?
>

It's unclear what you mean by "core team." If you mean the set of people
who can approve (+2) and submit code changes, then as Ian said, there are
more people outside Google than inside Google at this point.

On Mon, May 27, 2019 at 9:17 PM Matt Farina  wrote:

> As a concrete example: Cloudflare pretty heavily uses Go. When a
>> cloudflare-employee started stepping up to work more and more on the Go
>> crypto stack, they got hired by Google to do it fulltime. At least from the
>> outside, that seems to what happened with Filippo Valsorda.
>>
>
> That's fantastic. This shows some open source in action. It also
> highlights that this isn't open governance. If it did, Filippo joining the
> core team would have been a separate event from joining Google.
>

We did give Filippo the ability to +2 (review, approve, and submit) crypto
CLs while he was still at Cloudflare, so in that sense it *was* a separate
event. Filippo being at Google now means that working directly on Go can be
his full-time job now. My understanding is that he had responsibilities at
Cloudflare beyond contributing to the Go project.

A better example might be the various engineers who work at companies like
Intel, ARM, and Microsoft on Go support for those companies' processors and
operating systems. Many of them can now +2 code change as well, and they do
so within their area of expertise.

Best,
Russ

-- 
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/CAA8EjDR_qT0HCT%3DCiZbOW2NrkyD6gCQ3_5gPTH12MVK71GQyYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: How to constant ?!

2019-05-28 Thread David Finkel
On Tue, May 28, 2019 at 11:04 AM Trig  wrote:

> Whoops... forgot to add the top line to the code syntax.  I really wish
> you could edit existing posts in this group.
>
> On Tuesday, May 28, 2019 at 10:03:05 AM UTC-5, Trig wrote:
>>
>> package main
>>
>> import "fmt"
>>
>> const (
>>  ExposedConstant  = "1"  // exposed outside of package
>>  internalConstant = "2"  // for use anywhere in package only
>> )
>>
>> func main() {
>>  const functionConstant = "3"  // usable anywhere in main func
>>
>>  fmt.Println(ExposedConstant, internalConstant, functionConstant)
>> }
>>
>>
>>
https://golang.org/ref/spec#Constants
Note that the const keyword can only be used with primitive types.
For more complicated values, I tend to use functions/methods. (the GC
compiler's inliner is smart enough to inline a function call to a function
with exactly one return statement containing a small struct literal)

e.g. https://play.golang.org/p/AaLXcZ-CYEY

package main
> import "fmt"
> // Foo is a structtype Foo struct {
>   A int
>   B string
> }
> // DefaultFoo returns a useful default structfunc DefaultFoo() Foo {
>   return Foo{
>   A: 1,
>   B: "abcd",
>   }
> }
> // Bim does somethingfunc Bim() {
>   fmt.Printf("%+v\n", DefaultFoo())
> }
>
>


>> On Tuesday, May 28, 2019 at 7:12:06 AM UTC-5, Ashutosh Baghel wrote:
>>>
>>> Hello folks,
>>>
>>> I want to declare a few variables constant. But I guess there is nothing
>>> as "Constant" type in GoLang. How do I achieve this in GoLang?
>>>
>> For those with an interest in the inlining behavior, Matt Godbolt's
Compiler Explorer supports Go. Here's a small modification of the example
above (mostly just moved it out of the main package and removed the imports
to reduce the amount of code generated): https://go.godbolt.org/z/izOJVU

-- 
> 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/c9b3b7df-b2da-42ce-bd9e-44ee1eb589ba%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CANrC0Bj_iiNPTxVzXF%2By4r-H4DXa7_HU%2BjF9%3D1jk7juvZ34zSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Need help with VSCode, GOPATH and intellisense

2019-05-28 Thread Trig
I only got mine working 99% of the time with a language server configured 
in my settings:

{
"go.useLanguageServer": true,
"go.languageServerExperimentalFeatures": {
"diagnostics": true // for diagnostics as you type
},
"[go]": {
"editor.snippetSuggestions": "none",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"gopls": {
"usePlaceholders": true, // add parameter placeholders when completing a 
function
"enhancedHover": true, // experimental to improve quality of hover (will be 
on by default soon)
},
"eslint.autoFixOnSave": true,
"prettier.eslintIntegration": true
}


On Tuesday, May 28, 2019 at 5:32:51 AM UTC-5, Subramanian Sridharan wrote:
>
> I cannot use intellisense and have my own source packages be recognized at 
> the same time.
>
> Golang Server - ON
> Infer GOPATH from root - False
> GOPATH - Empty
> Result - I get details on hover. But my own source package imports fail.
>
> Golang Server - ON
> Infer GOPATH from root - True
> GOPATH - Empty
> Result - Source package imports don't show error. No information on hover.
>
> Golang Server - ON
> Infer GOPATH from root - False
> GOPATH - ~/go:~/dc_native   // The src is actually in ~/dc_native/x/y/
> Result - I get details on hover. But my own source package imports fail.
>
> Golang Server - ON
> Infer GOPATH from root - False
> GOPATH - ~/go:~dc_native/x/y  // Inside which src containing own source 
> packages are present.
> Result - Source package imports don't show error. No information on hover.
>
> At some point, intellisense was working where I was able to get 
> suggestions for structure members from another file of the same package.
> I can't get that to work now.
>
> Where am I going wrong?
>
> PS: The GOPATH paths are actually absolute and not relative.
>
>
>

-- 
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/30ac3372-a454-4173-8326-cac893894d0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: How to constant ?!

2019-05-28 Thread Trig
Whoops... forgot to add the top line to the code syntax.  I really wish you 
could edit existing posts in this group.

On Tuesday, May 28, 2019 at 10:03:05 AM UTC-5, Trig wrote:
>
> package main
>
> import "fmt"
>
> const (
>  ExposedConstant  = "1"  // exposed outside of package
>  internalConstant = "2"  // for use anywhere in package only
> )
>
> func main() {
>  const functionConstant = "3"  // usable anywhere in main func
>
>  fmt.Println(ExposedConstant, internalConstant, functionConstant)
> }
>
>
>
> On Tuesday, May 28, 2019 at 7:12:06 AM UTC-5, Ashutosh Baghel wrote:
>>
>> Hello folks,
>>
>> I want to declare a few variables constant. But I guess there is nothing 
>> as "Constant" type in GoLang. How do I achieve this in GoLang?
>>
>

-- 
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/c9b3b7df-b2da-42ce-bd9e-44ee1eb589ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: How to constant ?!

2019-05-28 Thread Trig
package main

import "fmt"

const (
 ExposedConstant  = "1"  // exposed outside of package
 internalConstant = "2"  // for use anywhere in package only
)

func main() {
 const functionConstant = "3"  // usable anywhere in main func

 fmt.Println(ExposedConstant, internalConstant, functionConstant)
}



On Tuesday, May 28, 2019 at 7:12:06 AM UTC-5, Ashutosh Baghel wrote:
>
> Hello folks,
>
> I want to declare a few variables constant. But I guess there is nothing 
> as "Constant" type in GoLang. How do I achieve this in GoLang?
>

-- 
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/77ac85b1-a1d5-4a00-b0de-08681356f32d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Test a Golang API on the web

2019-05-28 Thread Agniva De Sarker
I think the Heroku free tier is a great tool for this. 

On Monday, 27 May 2019 20:01:38 UTC+2, aimar wrote:
>
> Hi,
>
> My teacher has asked me to develop an API with Golang and test it on the 
> web instead of localhost. I was thinking of github.io but then I figured 
> out, it doesn't support server-side languages and just support static 
> pages. Would you please let me know, if there is any platform which I can 
> test my API online rather than localhost? (for free, of course) 
> It is worth to mention my API generally generates just a couple of strings 
> from a JSON file, thus it does not need a database.
>
> thanks,
> Aimar
>

-- 
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/68fa924c-3986-4f4c-94ef-6f3af595710b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] How to constant ?!

2019-05-28 Thread David Riley
On May 28, 2019, at 8:12 AM, Ashutosh Baghel  wrote:
> 
> Hello folks,
> 
> I want to declare a few variables constant. But I guess there is nothing as 
> "Constant" type in GoLang. How do I achieve this in GoLang?

https://tour.golang.org/basics/15

-- 
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/28D8407C-68A0-4839-8E42-E94A2680E0D4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] How to constant ?!

2019-05-28 Thread Ashutosh Baghel
Hello folks,

I want to declare a few variables constant. But I guess there is nothing as 
"Constant" type in GoLang. How do I achieve this in GoLang?

-- 
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/3c21c30c-ad94-47d6-af3d-51ddf2f3b8ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Need help with VSCode, GOPATH and intellisense

2019-05-28 Thread Subramanian Sridharan
I cannot use intellisense and have my own source packages be recognized at 
the same time.

Golang Server - ON
Infer GOPATH from root - False
GOPATH - Empty
Result - I get details on hover. But my own source package imports fail.

Golang Server - ON
Infer GOPATH from root - True
GOPATH - Empty
Result - Source package imports don't show error. No information on hover.

Golang Server - ON
Infer GOPATH from root - False
GOPATH - ~/go:~/dc_native   // The src is actually in ~/dc_native/x/y/
Result - I get details on hover. But my own source package imports fail.

Golang Server - ON
Infer GOPATH from root - False
GOPATH - ~/go:~dc_native/x/y  // Inside which src containing own source 
packages are present.
Result - Source package imports don't show error. No information on hover.

At some point, intellisense was working where I was able to get suggestions 
for structure members from another file of the same package.
I can't get that to work now.

Where am I going wrong?

PS: The GOPATH paths are actually absolute and not relative.


-- 
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/65f2ba9c-944f-455a-b4da-04f5d837efc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.