nteger
>>> on your certs serial numbers to see which if any are old...
>>>
>>> var tbs cryptobyte.String seems to imply it is using
>>> "golang.org/x/crypto/cryptobyte"
>>> so that code would be, in the v0.39.0 version,
>>>
&
This may be better asked in a k8s forum, but I'm not aware of a good one,
and as I've never seen this anywhere but in Go applications, perhaps
someone here will know about this.
In our enterprise, we have a bunch of k8s clusters. I have a bunch of Go
code using the k8s client api to get data f
PM UTC-7 Brian Candler wrote:
> On Monday, 9 June 2025 at 20:15:52 UTC+1 David Karr wrote:
>
> I did. It fails to parse dates with two digits for the month or day.
>
>
> Can you show a specific example?? It works for me:
> https://go.dev/play/p/hu0q9uInP_h
>
>
--
Yo
I did. It fails to parse dates with two digits for the month or day.
On Monday, June 9, 2025 at 12:05:26 PM UTC-7 burak serdar wrote:
>
>
> On Mon, Jun 9, 2025, 10:00 PM David Karr wrote:
>
>> I've used "time.Parse()" several times in various small applica
I've used "time.Parse()" several times in various small applications, and
today I realized a curious inflexibility with it. If I have to parse date
values where the months or days could be either 1 or 2 digits, which is all
cases if the code might be dealing with dates anywhere in the year, the
I haven't had to download a module from remote for a while. Today I am
seeing the following:
*go: module k8s.io/client-go/tools/clientcmd: Get
"https://proxy.golang.org/k8s.io/client-go/tools/clientcmd/@v/list": tls:
failed to parse certificate from server: x509: negative serial number*
With
eader(http.StatusOK)
> }
>
> server := newMockServer(handler)
> defer server.Close()
>
> client := server.Client()
> client.Get(server.URL)
>
> }
>
> func newMockServer(handlerFunc http.HandlerFunc) *httptest.Server {
> return
A little while ago, I was able to write some unit tests for some code that
makes an http connection. I created a mockserver and a client using that
server. That test in that application works fine.
I'm now trying to do basically the same thing in a different application.
I'm trying to start wi
I wrote some code to load a yaml file and do some work with the resulting
data. I'm using the "gopkg.in/yaml.v2" package for it. This has been
working fine for properly formatted YAML. However, today I discovered that
a slightly misformatted YAML file is being happily loaded by this code,
wi
anch string,
commits []T) {
commitsCacheMutex.Lock()
defer commitsCacheMutex.Unlock()
var anyResult []any
for _, commit := range commits {
anyResult = append(anyResult, commit)
}
commitsCache[project+"/"+repo+"/"+branch] = anyResult
}
On Wednesday, February 12, 2025 at 2:33
Wed, Feb 12, 2025 at 10:54 PM David Karr wrote:
>
> `[]any` is a slice type (https://go.dev/ref/spec#Slice_types), not an
> interface type (https://go.dev/ref/spec#Interface_types).
>
> But type assertions, as in `expr.(someType)`, are valid only for
> interface types: ht
I don't expect this should be very difficult, go-wise, but I haven't
written much code with generics yet.
I have an application that can read commits from either github or
bitbucket, but each run will either be for bitbucket or github, not both.
I have to retrieve the commits for a branch a co
I'm currently using Go 1.23.2. We have a few applications that reference
packages on github. We're now in a situation where we have to ensure that
packages are obtained from our internal github proxy, not directly from
github.
So, I set GOPROXY to point to the repository we set up for this, a
This is probably basic, but I'm working on some code that unmarshals JIRA
tickets (just for some context). Examining the Json output, there is a big
"fields" object that mostly contains custom fields, but also some defined
fields. Right now, I defined "Fields" as a "map[string]any", which is
approp
I'm relatively new to golang, although I'm pretty familiar with
Kubernetes. I want to see if I can use client-go as a framework for a set
of scripts that get (or set) information on a specific cluster. I don't
want to use the current context, I want to set the context name on the
command line
process the
> 1st parameter
> // Then
> rootCmd.SetArgs(os.Args[2:])
> rootCmd.Execute()
> }
>
> On Sun, Feb 25, 2024 at 1:50 PM David Karr wrote:
> >
> > But where would that be done? I'm not certain of the exact role of the
> "rootCmd.Execute(
process the first
> parameter yourself.
>
> On Sun, Feb 25, 2024 at 11:43 AM David Karr wrote:
> >
> > I am not a new programmer, but I am pretty new to golang, having only
> written a couple of small applications, and that was several months ago.
> I'm trying t
I am not a new programmer, but I am pretty new to golang, having only
written a couple of small applications, and that was several months ago.
I'm trying to construct an application using Cobra, using some nonstandard
conventions. Is it better to ask a question like this in an issue in the
Cobr
There is nothing new here. Every programming language, framework, and tool
has had the same problem. Quality documentation and training is often the
hardest thing to produce, and is often deemphasized in budgets. It's also
part of the last 10% of doing something that usually takes 90% of the time
Ok. I did that. https://github.com/golang/go/issues/51337 .
On Wed, Feb 23, 2022 at 4:20 PM Ian Lance Taylor wrote:
> On Wed, Feb 23, 2022 at 1:46 PM David Karr
> wrote:
> >
> > A while ago, I wrote a small Go app that reads things from zip files. I
> tested it w
A while ago, I wrote a small Go app that reads things from zip files. I
tested it with various zip files (usually Java jar files), and it has
always worked perfectly fine.
Today I'm looking at another jar file. The Java "jar" command likes it
perfectly fine. I could list the contents and extr
I had earlier written a note about troubles refactoring my project to have
a "src" directory, but I've backed off on that for now. I see that the
main problem I saw with that hasn't changed when backing out those changes.
It appears that running this build inside a docker image seems to be
som
I had a small go application building successfully. I had the go.mod and
main.go in the root directory of the project, and I was building it pretty
easily with a Makefile, which just did the following:
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o
target/dist/linux-amd64
I decided I w
When I enter "go help build", the first few lines shows this:
usage: go build [-o output] [build flags] [packages]
Build compiles the packages named by the import paths,
The instructions say very little about what can be supplied as "packages".
It says it can be a list of .go files, and app
On Saturday, November 27, 2021 at 1:13:12 PM UTC-8 David Karr wrote:
> On Sat, Nov 27, 2021 at 11:57 AM Ian Lance Taylor
> wrote:
>
>> On Sat, Nov 27, 2021 at 11:01 AM David Karr
>> wrote:
>> >
>> > I'm aware of the "build constraints&qu
On Sat, Nov 27, 2021 at 11:57 AM Ian Lance Taylor wrote:
> On Sat, Nov 27, 2021 at 11:01 AM David Karr
> wrote:
> >
> > I'm aware of the "build constraints" mechanism, which lets individual
> files be only compiled on specific oses or architectures.
> &g
I'm aware of the "build constraints" mechanism, which lets individual files
be only compiled on specific oses or architectures.
I am constructing an app that has a single cgo module, which is the "meat"
of the application (longest module). In my poc, the cgo header specifies a
lib path with "li
;%v\n", f)
> if err != nil {
> fmt.Println("NO FILE")
> //return
>}
>defer f.Close()
>fmt.Println("END")
> }
>
>
> Am Do., 25. Nov. 2021 um 21:43 Uhr schrieb David Karr <
> davidmichaelk...@gmail.com&
And did you test that with a file path that would fail?
On Thu, Nov 25, 2021, 11:40 Roland Müller wrote:
> Hello,
>
> actually trying this with os.Open() the program behaves the same
> regardless whether the defer is before or after the error handling, Thus,
> no panic :-)
>
> Isn't anything dec
On Wed, Nov 24, 2021 at 6:14 PM Fannie Zhang wrote:
> Hi all,
>
> There is some incorrect code in
> https://go.dev/blog/defer-panic-and-recover blog.
>
> The original code is
> *func CopyFile() {*
> * ...*
> * if err != nil {*
> * return*
> * }*
> * defer src.Close()*
> * ...*
> *}
On Monday, November 15, 2021 at 3:49:20 PM UTC-8 David Karr wrote:
>
> I'm pretty new to Go (many years in other languages). I'm trying to use
> cgo to use a C library we're using.
>
> I have the following line of code, which is compiling (that's been enough
I'm pretty new to Go (many years in other languages). I'm trying to use
cgo to use a C library we're using.
I have the following line of code, which is compiling (that's been enough
of a struggle):
status = int(C.VeProtect(C.VeObj(fpeProtect), &argsProtect))
This is failing at runtime with
32 matches
Mail list logo