,SeekCurrent,SeekEnd}
> (0, 1 or 2).
> go doc os.File.Seek
>
> On Apr 8, 2024, at 2:24 PM, Nikhilesh Susarla wrote:
>
> github/file-seek/main.go
> <https://github.com/susarlanikhilesh/file-seek-failure/blob/main/main.go>
>
> I did write with ReadOnly also and
024, 3:33 PM Nikhilesh Susarla
> wrote:
>
>> I wanted to seek around a file by opening it using read-only, but then I
>> get this error called "Invalid argument"
>>
>> https://go-review.googlesource.com/c/go/+/14881
>>
>> I read the above link
I wanted to seek around a file by opening it using read-only, but then I
get this error called "Invalid argument"
https://go-review.googlesource.com/c/go/+/14881
I read the above link and they say it is not supported to seek around. I
tried direct lseek in c language and it failed with same.
Packages are inside modules.
Package is nothing but collection of go files under a folder of that
package name
But without modules also we can import packages.
Can someone point out the exact and main difference between package vs
modules in golang.
Thank you
--
You received this message
Hello,
// main.go
package main
import (
"sync"
"time"
)
func main() {
var wg sync.WaitGroup
go lolsleep()
wg.Add(1)
wg.Wait()
}
func lolsleep(wg *sync.WaitGroup) {
wg.Done()
time.Sleep(3 * time.Second)
}
go vet main.go
Why isn't go vet complaining that wg.Add is happening after the
I was creating a cli application. I was building, testing it and all of
sudden I made few code changes and then I wanted to do go run main.go, it
gives me below error.
fork/exec
C:\Users\cydri\AppData\Local\Temp\go-build2802953115\b001\exe\main.exe:
Operation did not complete successfully
I was going through a blog where they compare different language threads to
see how much memory they consume for a million tasks.
Blog : https://pkolaczk.github.io/memory-consumption-of-async/
Do we have any benchmarking/report before that Go routines take more memory
with more threads?
I
So the SigPanic() captures the "_SIGSEGV" and then panics the whole
program right?
On Monday, 26 December 2022 at 23:49:12 UTC+5:30 Ian Lance Taylor wrote:
> On Mon, Dec 26, 2022 at 9:49 AM Nikhilesh Susarla
> wrote:
> >
> > https://play.golang.com/p/xpuit5lh9hh
&g
Hello Gophers,
https://play.golang.com/p/xpuit5lh9hh
An array out of bounds throws panic at runtime.
How does the internal runtime know that we are accessing the memory which
we are not allocated? Interested in knowing more depth of the internals.
This Link
Hi,
I want to check if my system is connected to internet or not.
1. Say I may be connected to wifi but there is no internet.
2. Connected in lan but there is no internet
So, I want a low level package to get the status of the network card or
related in Go. Rather than just querying
Before anyone takes a look, can you please place the code
in https://go.dev/play/ and then share that link where the code compiles
and if it works on the browser and you have specific settings for goarch
and goos then gophers can take a look at it.
Thank you
On Thursday, 24 November 2022 at
Got it. I was wrong.
time.NewTicker would panic if duration is negative.
But if the duration is used widely in negative then fine :)
Thank you for correcting
On Tuesday, 22 November 2022 at 16:03:58 UTC+5:30 Volker Dobler wrote:
> On Tuesday, 22 November 2022 at 11:28:15 UTC+1
Hi,
type Duration int64
The current Duration is int64 and the duration value should never be less
than 0 else it will panic. It would be safe and advisable to change it to
uint64 or so, where at least it would not cause panic.
Is there any reason for not using uint?
Thank you
Susarla
Hi,
I have an int64 value say 12
I want to convert that to []byte array.
How do we do that. There were lot of ways on the internet. Nothing which
golang specifies or has a built-package for direct conversions. Lot of them
dealt with Endiean's, but that might cause issues to I believe.
So, is
Hi,
https://play.golang.com/p/uXOgD0PNc-p
I was trying to declare unicode variable name as Go supports it.
The language I used is Telugu. It's corresponding chart
(https://unicode.org/charts/PDF/U0C00.pdf)
But I get the compilation issue. Am I missing anything ?
If I write Japanese variable
; func (notQuiteEOF) Is(other error) bool {
> return other == io.EOF
> }
>
> This allows errors to be considered "the same" under `errors.Is`, while
> not actually being the same and it's probably the recommended mechanism to
> "imitate" an error from a di
io/io.go;drc=90b40c0496440fbd57538eb4ba303164ed923d93;l=44
>
> If the error is created by code other than your own, and that code does
> not reuse the same error, then compare strings.
>
>
> On Sat, Nov 5, 2022 at 12:39 PM Nikhilesh Susarla
> wrote:
>
>> Oh I see.
>>
if package A chose the same
>> error sentinel text as package B and suddenly their sentinels compare as
>> equal.
>> If you want error identity between values, you have to actually copy the
>> error value (or implement your own, which may very well not do it this way).
>
Same interface comparison
https://play.golang.com/p/9hHlTDosYzz
Why is the equals too still returning false?
Any more details on this?
Thank you
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
Hi,
I have a local package Z under X/Y folder
So, to use the local package Z, I changed in the go.mod of the other
package which wants to use it.
replace X/Y/Z => ../Z
After that if I run go mod tidy.
This should ideally create an entry in requires with X/Y/Z
Okay. I get it.
When I ran through go playground I missed that type receiver was of pointer
type, so I was not sure why it didn't print as mentioned in the docs
Thank you
On Thursday, 10 March 2022 at 09:00:49 UTC+5:30 kortschak wrote:
> On Wed, 2022-03-09 at 19:16 -0800, Nikhilesh Susa
In https://go.dev/doc/effective_go#printing
I saw an example for printing our custom string output for the type.
The code below is from docs.
func (t *T) String() string {
return fmt.Sprintf("%d/%g/%q", t.a, t.b, t.c)
}
fmt.Printf("%v\n", t)
But rather the statement should be this right?
I have an init func in a package.
Inside the init function, I have a database initialization which returns
error. How can I handle that error failure incase if it fails in the init
function.
Thank you
Nikhilesh
--
You received this message because you are subscribed to the Google Groups
I did place them in go.work file only.
I commented the package in go.mod file.
On Wed, Feb 9, 2022 at 7:07 PM Manlio Perillo
wrote:
> The `use` directive must be added in the go.work file, not in the go.mod
> file.
> Also, you can use `go work use` command, instead of manually editing the
>
I updated the project.
ran go work init cmd
then added
use ../go-bitswap
replace github.com/ipfs/go-bitswap v0.5.1 => ../go-bitswap`
and comment in my go.mod file.
But when I run go mod tidy it comes back in the go.mod file.
using go 1.18v
workspace : D:\test\workspace
hierarchy :
>
> I was trying to init the work file as instructed, but I have a package
>> which still doesn't work in 1.18
>>
>> [image: image.png]
>> So, is there any other alternative?
>>
>> Thank you
>> Susarla Nikhilesh
>>
>
--
You received this message because you are subscribed to the Google Groups
The replace works. But somehow lately I'm facing issue with replace.
In my go.mod file I wrote replace for the package referring it to local
package using ../package name
But when I go do go mod tidy in that package, it brings back that package
referring to the github.com in the require.
I'm
Hello,
Is there any documentation or a site where the crypto algos which are
implemented in the crypto package has their relative compliance page?
Example:
crypto/rsa
rsa.GenerateKey()
Is there a page where the generation of the key is following FIPS compliant
standards? If so please do
28 matches
Mail list logo