Hello All -
I'm happy to announce, aah v0.10 have been released.
Website: https://aahframework.org
Release Notes: https://docs.aahframework.org/v0.10/release-notes.html
Your feedback is very valuable. Thanks.
Cheers,
Jeeva
--
You received this message because you are subscribed to the
Hi,
Sorry to revive an age old thread, but I'm encountering this error and it
seems my files are already utf-8:
$ file -I main.go
main.go: text/x-c; charset=utf-8
$ file -I cmd/root.go
cmd/root.go: text/x-c; charset=utf-8
Is there any programmatic way to detect the messed up character?
I implemented a type registry solution for this situation:
https://github.com/rcoreilly/goki/tree/master/ki/kit
you just add a one-liner after every struct you want to register, and it builds
the map for you — makes it fully modular, etc. Cheers,
- Randy
> On Mar 28, 2018, at 12:59 PM, Alex
Hi!
On Wed, Mar 28, 2018 at 02:13:55PM -0400, Shawn Milochik wrote:
> Thanks for the challenge! I found some unused code in the getItem function,
> and a way to make it a bit shorter by removing the lookup map. However,
> depending on the number of struct types the map may be cleaner for OP.
>
>
Thanks for the challenge! I found some unused code in the getItem function,
and a way to make it a bit shorter by removing the lookup map. However,
depending on the number of struct types the map may be cleaner for OP.
https://play.golang.org/p/ZH09nHsrRoR
--
You received this message because
Hi!
On Wed, Mar 28, 2018 at 01:38:04PM -0400, Shawn Milochik wrote:
> Yes, you can do this. Perhaps someone knows of some kind of cleaner
> shortcuts to get there, but this works and is easy to understand without
> any magic:
>
> https://play.golang.org/p/tqon7s2KxTz
Here is a bit simplified
On Wed, Mar 28, 2018 at 9:04 AM, Nilsocket wrote:
>
> package main
>
> import (
> "fmt"
> "unsafe"
> )
>
> func main() {
> showString("12345")
> }
>
> func showString(s string) {
> res := *(*[unsafe.Sizeof(s)]byte)(unsafe.Pointer())
> fmt.Println(s, res,
Yes, you can do this. Perhaps someone knows of some kind of cleaner
shortcuts to get there, but this works and is easy to understand without
any magic:
https://play.golang.org/p/tqon7s2KxTz
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
[...] a copy *of* the pointed-to value.
On Wednesday, March 28, 2018 at 6:54:53 PM UTC+2, thwd wrote:
>
> Hi. Don't worry, I do get pointers and pass-by-value.
>
> I expected the expression (*x) to yield a copy to the pointed-to value.
>
> But, as you say, that happens on assignment.
>
> On
Hi. Don't worry, I do get pointers and pass-by-value.
I expected the expression (*x) to yield a copy to the pointed-to value.
But, as you say, that happens on assignment.
On Wednesday, March 28, 2018 at 6:50:06 PM UTC+2, Devon H. O'Dell wrote:
>
> 2018-03-28 9:39 GMT-07:00 Devon H. O'Dell
2018-03-28 9:39 GMT-07:00 Devon H. O'Dell :
> CopyExplicitDeref gets a pointer to the struct in its receiver. If you
> have a pointer to T, then taking a pointer to the dereferenced T is a
> no-op: you get the pointer of the thing you just dereferenced. Any
> statement
CopyExplicitDeref gets a pointer to the struct in its receiver. If you
have a pointer to T, then taking a pointer to the dereferenced T is a
no-op: you get the pointer of the thing you just dereferenced. Any
statement &*whatever will always yield the value of whatever. Copy
happens on assignment,
On Wed, 28 Mar 2018, at 5:21 PM, thwd wrote:
> https://play.golang.org/p/pjyoPX99Zr1
>
> Taking the address of an explicit dereference has different behavior
> than implicitly dereferencing and taking address.>
> Is this the desired behavior? It surprised me.
I think the naming of your
You can also keep a map between the string form and the reflect.Type to
instantiate, something like https://play.golang.org/p/XCfpjQwumkZ
However, the Go proverb is true: "Reflection is never clear"
https://go-proverbs.github.io/
On Wed, Mar 28, 2018 at 5:58 AM,
https://play.golang.org/p/pjyoPX99Zr1
Taking the address of an explicit dereference has different behavior than
implicitly dereferencing and taking address.
Is this the desired behavior? It surprised me.
--
You received this message because you are subscribed to the Google Groups
package main
import (
"fmt"
"unsafe"
)
func main() {
showString("12345")
}
func showString(s string) {
res := *(*[unsafe.Sizeof(s)]byte)(unsafe.Pointer())
fmt.Println(s, res, []byte(s))
for i := range res {
fmt.Printf("%.2x", res[i])
}
fmt.Println()
}
gopkg.in/goracle.v2 users report that tdm-gcc64 works for them.
--
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.
For
Hello,
I am using go application as service in linux docker environment. My
application is given 1 cpu when defining docker-compose file.
I enabled to cpu profiler within my application. After running my testing,
I stop my container and using docker cp, I copied test.prof into local host.
On Wed, Mar 28, 2018 at 6:17 AM, Luke Mauldin wrote:
> Can someone please tell me what the golang team uses as the reference windows
> x64 compiler? I have heard references to mingw64 but it would be helpful to
> know the exact version they are using for their unit tests
Can someone please tell me what the golang team uses as the reference windows
x64 compiler? I have heard references to mingw64 but it would be helpful to
know the exact version they are using for their unit tests on Windows. I am
experiencing different cgo windows behavior in 1.10 than 1.9.3
Thanks. I read that blog post earlier and presents two different ways of
handling this. Each maintains a list of switch cases and constants
respectively so still not entirely dynamic.
I'll probably just go with a switch then.
On Wednesday, 28 March 2018 13:25:47 UTC+1, Andrei Tudor Călin
It isn't really possible to do so because there is no nice and type safe
way of getting from a string in the JSON to a Go type,
and a value of said type. You must write a little bit of extra code.
This article: http://eagain.net/articles/go-dynamic-json/ presents a good
approach.
On Wednesday,
Is it possible to unmarshall Json by selecting the struct from a field in
the Json?
I'm porting some PHP code to Go and this is something I may have to
approach differently.
Here is the Json:
[
{
"class": "Domain\\Model\\Message",
"skus": [
"FOO1"
],
Hi Jan,
I gave too many fixed values.
For this reason I was having trouble.
Regards.
28 Mart 2018 Çarşamba 14:32:05 UTC+3 tarihinde Jan Mercl yazdı:
>
> On Wed, Mar 28, 2018 at 1:20 PM ToSuNuS
> wrote:
>
> > Is there a way to write this more smoothly, or is there no
On Wed, Mar 28, 2018 at 1:20 PM ToSuNuS wrote:
> Is there a way to write this more smoothly, or is there no problem with
the function?
Hard to tell. What you've posted seems to not conform to the Go grammar.
Please try to share the snippet using the Go playground (
Hello friends,
I wrote a sample function like this.
func OsVersion () string {
result: = "some text"
if _, err: = os.Stat ("/ etc / redhat_version"); err == nil {
sed / s. \ release * / sed / s. \ / * * `) .Output () )
Check (err, "OsVersion does not work.")
result: = strings.TrimSpace (string
Thanks, there seems to be a tool already for most things in Go, just
wonderful!
Patrik Iselind
On Wed, Mar 28, 2018 at 10:54 AM, Ian Davis wrote:
> On Wed, 28 Mar 2018, at 8:32 AM, Patrik Iselind wrote:
>
> Is there such a tool that can go through a GoLang code base and
On Wed, 28 Mar 2018, at 8:32 AM, Patrik Iselind wrote:
> Is there such a tool that can go through a GoLang code base and
> suggest values that might be a good idea to convert into constants?>
> If a value (for example an int or a string, but excluding values that
> are already constants) is hard
Is there such a tool that can go through a GoLang code base and suggest
values that might be a good idea to convert into constants?
If a value (for example an int or a string, but excluding values that are
already constants) is hard coded at least X times in the code base, could
be a candidate
29 matches
Mail list logo