On Sun, May 5, 2019, 06:33 Immueggpain S wrote:
> Ah, my bad! What I meant was that binary.Read will pad when writing to the
> struct, unlike memcpy.
>
Oh, yes you're right of course.
If you want to serialize a C struct using Go, you're going to have to
mention every field on the Go side.
You
Ah, my bad! What I meant was that binary.Read will pad when writing to the
struct, unlike memcpy.
On Sat, May 4, 2019 at 10:50 AM Matt Harden wrote:
> Why do you think binary.Read should handle padding for you? Based on the
> documentation, it would be a bug if it did.
>
> On Tue, Apr 30, 2019
Why do you think binary.Read should handle padding for you? Based on the
documentation, it would be a bug if it did.
On Tue, Apr 30, 2019 at 4:42 AM Immueggpain S wrote:
> I guess I have no other choice then? BTW binary.Read shoud handle padding
> automatically.
>
> On Mon, Apr 22, 2019 at
I guess I have no other choice then? BTW binary.Read shoud handle padding
automatically.
On Mon, Apr 22, 2019 at 10:53 AM Ian Lance Taylor wrote:
> On Sat, Apr 20, 2019 at 11:53 AM wrote:
> >
> > binary.Read can't set unexported fields, right?
> > But my structs are defined in C, and I can't
On Sat, Apr 20, 2019 at 11:53 AM wrote:
>
> binary.Read can't set unexported fields, right?
> But my structs are defined in C, and I can't make all C source code using
> capital fields..
> What could I do?
Read the fields separately. That is often a better idea in any case,
as the result is
binary.Read can't set unexported fields, right?
But my structs are defined in C, and I can't make all C source code using
capital fields..
What could I do?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
On Sat, Oct 7, 2017 at 8:48 PM Johan terryn wrote:
> If I declare "in" as var of type os.File before the call to
binary.read(...)
> I get a compile error stating that in is not a reader, without the
declaration it works fine...
> just odd unexpected behavior.
Why not
If I declare "in" as var of type os.File before the call to binary.read(...)
I get a compile error stating that in is not a reader, without the
declaration it works fine...
just odd unexpected behavior.
Johan
On Thursday, October 5, 2017 at 9:16:18 PM UTC+2, Jan Mercl wrote:
>
> On Thu, Oct
On Thu, Oct 5, 2017 at 9:10 PM Johan terryn wrote:
> Here is the full (trimmed) working program:
The program compiles just fine (https://play.golang.org/p/Xg3qlovrzg),
where is the problem?
--
-j
--
You received this message because you are subscribed to the Google
Here is the full (trimmed) working program:
// Exif project Exif.go
package main
import (
//"bytes"
"encoding/binary"
"fmt"
"os"
)
const JPEGSOIMarker = 0xffd8
const APPMarkerBegin = 0xffe1
const APPMarkerEnd = 0xffef
const ExifEncoding = "II"
type Header struct {
On Thu, 5 Oct 2017, at 08:58 AM, Johan terryn wrote:
> In following code:
>
> type JPGFile struct {
> Exif_SOI [2]byte Exif } type Exif struct { APP1Marker [2]byte
> APP1DataSize uint16 ExifHeader [6]byte TIFFHeader[6]byte }> func
> ReadFile(filename string) (JPGFile, error) {
On Thu, Oct 5, 2017 at 5:22 PM Johan terryn wrote:
> Or is this working as intended?
Hard to tell w/o a complete, self contained reproduction program. But note
that os.File is not an io.Reader, *os.File is.
--
-j
--
You received this message because you are
In following code:
type JPGFile struct {
Exif_SOI [2]byte
Exif
}
type Exif struct {APP1Marker [2]byteAPP1DataSize uint16ExifHeader
[6]byteTIFFHeader[6]byte}
func ReadFile(filename string) (JPGFile, error) {
jpgFile := JPGFile{}
in, err :=
13 matches
Mail list logo