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
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
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
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
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 := {
ReadHeaderTimeout: 5 *
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
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
--
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#
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
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
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
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
// ... 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
> 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
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:
>
16 matches
Mail list logo