@Paul%20Jolly, me likey! There's a really clean tokenizer implementation,
and if nothing else that's really nice baseline to mimic!
On Sunday, April 10, 2022 at 5:36:18 AM UTC-5 Andrew Pillar wrote:
> > I think there are two big advantages to making your application
> > consume either plain JSON
Those nanosleep calls are at 10ms intervals - i.e. 100 calls per second. I
think this is normal behaviour of the Go scheduler, which signals itself
every 10ms to force a preemptive context switch. That feature was
introduced in go 1.14, at which point you were able to disable it at
runtime se
I skipped over to that package, and the doc says it converts from yaml to
json, and the marshals/unmarshals. I tried changing your snippet to use
struct tags with the key name as "json" instead of "yaml", and it
immediately behaved as expected: https://goplay.tools/snippet/PSZtr1YErD8
While you
I am new to GoLang and looking to join two keys (rules) from two different
Yamls.
I have been able to join the keys but I found that Unmarshal changes the
keys (example apiVersion to APIVersion, and kind to Kind).
Overall, my goal is to have a valid Kubernetes YAML manifest. This is what
I hav
Reading the spec probably isn't the best way to experience the "fun" in any
case. (Though the spec is worth a read once you've use the language a bit
-- as far as specs go, it's concise and readable.)
"Fun" is quite a personal thing, but similar people often have similar
experiences, so I'll ta
On Sun Apr 10, 2022 at 4:23 AM CEST, jlfo...@berkeley.edu wrote:
> Other than what's in the Go distribution, I haven't been able to find any
> packages for accessing .a archives. Is there anything else out there?
> Google wasn't helpful.
>
> Cordially,
> Jon Forrest
>
I found these using https://p
Hi,
On Linux, if I compile and run this simple program:
package main
import (
"fmt"
"net/http"
"time"
)
type x struct{}
func (x) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(""))
}
func main() {
sp := &http.Server{
ReadHeaderTimeo
On Sat Apr 9, 2022 at 3:56 PM CEST, 'Jack Li' via golang-nuts wrote:
> Why literal operation is exact, variable is not?
>
> fmt.Println(0.1 + 0.2) // 0.3 exactly
> fmt.Println(x + y) // 0.30004
>
Both aren't exact because floats can't represent 0.3 exactly, they
differ because literals
Hello,
I lack a motivation to read Go spec (long story) and I seek few stories
along the line "Go is fun", which it is, to motivate myself. Google didn't
give me any results, maybe you can tell me few reasons, why Go is fun?
I feel that it is fun, but can't tell why.
Best,
Kamil Ziemian
--
Y
Yes, something like that! I basically want to run my custom pass as I
compile using 'go build'
But looks like llvm-goc doesn't support the -Xclang option
*$ go build -gccgoflags="-Xclang -load -Xclang
../passes/FunctionInsertPass.so" cache_main.go#
command-line-arguments/gollvm/install/bin
Thanks! This seems obvious now just looking at it, but it was stumping me.
I might add for someone that may see this later, in the future it *might*
not be needed to do it this way, if all you really just want {Int | Float |
Rat} as future versions are supposed to let us use methods in such
constr
On Sun, Apr 10, 2022, 11:42 AM Aidan Hahn wrote:
> Hello Ian,
>
> I think some of your confusion may be because the function is poorly
> named. In some cases the Node generic may store another Node in the generic
> Inner field.
> In this case I want my preorder traversal to also traverse the list
Hello Ian,
I think some of your confusion may be because the function is poorly named.
In some cases the Node generic may store another Node in the generic Inner
field.
In this case I want my preorder traversal to also traverse the list in the
Inner field. "TreePreTraverse" would be a better na
You can use
type Comparable[T any] interface {
Cmp(other T) int
}
then *big.Int implements `Comparable[*big.Int]` and you can write
func cmpSort[T Comparable[T]](x []C) { … }
On Sun, Apr 10, 2022 at 7:48 PM Shawn Smith wrote:
> // ... imagine some comparison sort algorithm
>
> func cmpSor
// ... imagine some comparison sort algorithm
func cmpSort[C Cmpable](x []C) {
for i, val := range x {
if i == 0 {
continue
}
_ = val.Cmp(x[i-1])
}
}
// Cmpable should include big.Int, big.Float, big.Rat, by virtue of their
Cmp methods. So how do i def
> I think there are two big advantages to making your application
> consume either plain JSON or YAML configs:
> 1. Everyone is familiar with them
> 2. You can use a more advanced tool like cue or jsonnet to generate
> them
I can see why people would prefer JSON, and I think it's fine for
storing
Cue (and jsonnet) come into their own when building large systems built out
of multiple components; they can create configs for multiple applications
derived from a shared top-level configuration. However, the applications
themselves don't have to understand cue or jsonnet, since both those can
Hi Adam,
thanks for that article. I really like the idea and will try it on one of my
next projects.
Cheers,
Chris
On Thu, Apr 07, 2022 at 01:33:49PM -0700, 'Adam Berkan' via golang-nuts wrote:
> Khan Academy Engineering Blog Post:
> https://blog.khanacademy.org/statically-typed-context-in-go
18 matches
Mail list logo