text:
cmd/go: improve error message for missing dependencies when building files from another module

Let's say I have a module, foo, with a main.go file with a dependency on filippo.io/edwards25519. If I run or build main.go from inside foo, everything goes well.
If I run it or build it from outside the module, I get
$ go run foo/main.go
foo/main.go:3:8: no required module provides package filippo.io/edwards25519: working directory is not part of a module

If I run it or build it from inside a different module, I get
$ go run ../foo/main.go
../foo/main.go:3:8: no required module provides package filippo.io/edwards25519; to add it:
	go get filippo.io/edwards25519

In both cases, the error message could have noticed that main.go is inside a (different) module, and added something like
note: the file is in a module that is not active, to activate it:
	cd .../foo

(go run and go build with .go files are a constant source of confusion, got way less useful with modules because one can't just run arbitrary files as scripts from anywhere, and should IMHO be deprecated, but while we support them we should try to make them less painful.)

cc @bcmills @jayconrod @matloob

The not active terminology seems a bit confusing too. Perhaps:
note: foo/main.go is in a module rooted at ./foo; to use its dependencies, first change to a directory within that module:
	cd ../foo

Hmm, but if we're already in some other module, it's not obvious whether the right solution is to cd into that directory (using its dependencies instead of those of the current module), or to add replace and require directives to add it as a dependency of the current module.

(If we're currently not in any module at all, I think it would be reasonable to suggest the cd command.)

source: gharchive/issue

authors: FiloSottile bcmills cherrymui

repo: golang/go

license_type: permissive

license_source: github-api


text:
api: audit for Go 1.19

This is a tracking issue for doing an audit of API additions for Go 1.19 as of https://go.dev/cl/411394.
New API changes for Go 1.19
crypto/x509
Covered:

[x] pkg crypto/x509, method (*CertPool) Clone() *CertPool #35044
[x] pkg crypto/x509, method (*CertPool) Equal(*CertPool) bool #46057
[x] pkg crypto/x509, func ParseRevocationList([]uint8) (*RevocationList, error) #50674
[x] pkg crypto/x509, method (*RevocationList) CheckSignatureFrom(*Certificate) error #50674
[x] pkg crypto/x509, type RevocationList struct, AuthorityKeyId []uint8 #50674
[x] pkg crypto/x509, type RevocationList struct, Extensions []pkix.Extension #50674
[x] pkg crypto/x509, type RevocationList struct, RawIssuer []uint8 #50674
[x] pkg crypto/x509, type RevocationList struct, Signature []uint8 #50674

Not covered that I can see:

[ ] pkg crypto/x509, type RevocationList struct, Issuer pkix.Name #50674
[ ] pkg crypto/x509, type RevocationList struct, Raw []uint8 #50674
[ ] pkg crypto/x509, type RevocationList struct, RawTBSRevocationList []uint8 #50674

debug/elf

[x] pkg debug/elf, const EM_LOONGARCH = 258 #46229
[x] pkg debug/elf, const EM_LOONGARCH Machine #46229
[x] pkg debug/elf, const R_LARCH_32 = 1 #46229
[x] pkg debug/elf, const R_LARCH_32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_64 = 2 #46229
[x] pkg debug/elf, const R_LARCH_64 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_ADD16 = 48 #46229
[x] pkg debug/elf, const R_LARCH_ADD16 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_ADD24 = 49 #46229
[x] pkg debug/elf, const R_LARCH_ADD24 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_ADD32 = 50 #46229
[x] pkg debug/elf, const R_LARCH_ADD32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_ADD64 = 51 #46229
[x] pkg debug/elf, const R_LARCH_ADD64 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_ADD8 = 47 #46229
[x] pkg debug/elf, const R_LARCH_ADD8 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_COPY = 4 #46229
[x] pkg debug/elf, const R_LARCH_COPY R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_IRELATIVE = 12 #46229
[x] pkg debug/elf, const R_LARCH_IRELATIVE R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_JUMP_SLOT = 5 #46229
[x] pkg debug/elf, const R_LARCH_JUMP_SLOT R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_MARK_LA = 20 #46229
[x] pkg debug/elf, const R_LARCH_MARK_LA R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_MARK_PCREL = 21 #46229
[x] pkg debug/elf, const R_LARCH_MARK_PCREL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_NONE = 0 #46229
[x] pkg debug/elf, const R_LARCH_NONE R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_RELATIVE = 3 #46229
[x] pkg debug/elf, const R_LARCH_RELATIVE R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_ADD = 35 #46229
[x] pkg debug/elf, const R_LARCH_SOP_ADD R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_AND = 36 #46229
[x] pkg debug/elf, const R_LARCH_SOP_AND R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_ASSERT = 30 #46229
[x] pkg debug/elf, const R_LARCH_SOP_ASSERT R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_IF_ELSE = 37 #46229
[x] pkg debug/elf, const R_LARCH_SOP_IF_ELSE R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_NOT = 31 #46229
[x] pkg debug/elf, const R_LARCH_SOP_NOT R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 = 40 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 = 41 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 = 42 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 = 38 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 = 43 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_U = 46 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_U R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 = 39 #46229
[x] pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE = 23 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_DUP = 24 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_DUP R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL = 25 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL = 22 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL = 29 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD = 28 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT = 27 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL = 26 #46229
[x] pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_SL = 33 #46229
[x] pkg debug/elf, const R_LARCH_SOP_SL R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_SR = 34 #46229
[x] pkg debug/elf, const R_LARCH_SOP_SR R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SOP_SUB = 32 #46229
[x] pkg debug/elf, const R_LARCH_SOP_SUB R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SUB16 = 53 #46229
[x] pkg debug/elf, const R_LARCH_SUB16 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SUB24 = 54 #46229
[x] pkg debug/elf, const R_LARCH_SUB24 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SUB32 = 55 #46229
[x] pkg debug/elf, const R_LARCH_SUB32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SUB64 = 56 #46229
[x] pkg debug/elf, const R_LARCH_SUB64 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_SUB8 = 52 #46229
[x] pkg debug/elf, const R_LARCH_SUB8 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPMOD32 = 6 #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPMOD32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPMOD64 = 7 #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPMOD64 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPREL32 = 8 #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPREL32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPREL64 = 9 #46229
[x] pkg debug/elf, const R_LARCH_TLS_DTPREL64 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_TPREL32 = 10 #46229
[x] pkg debug/elf, const R_LARCH_TLS_TPREL32 R_LARCH #46229
[x] pkg debug/elf, const R_LARCH_TLS_TPREL64 = 11 #46229
[x] pkg debug/elf, const R_LARCH_TLS_TPREL64 R_LARCH #46229
[x] pkg debug/elf, method (R_LARCH) GoString() string #46229
[x] pkg debug/elf, method (R_LARCH) String() string #46229
[x] pkg debug/elf, type R_LARCH int #46229

debug/pe

[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY = 2 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY ideal-int #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE ideal-int #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH = 4 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH ideal-int #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST = 6 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST ideal-int #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES = 1 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES ideal-int #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE = 3 #51868
[x] pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_CODE = 32 #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_CODE ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA = 64 #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 #51868
[x] pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_LNK_COMDAT = 4096 #51868
[x] pkg debug/pe, const IMAGE_SCN_LNK_COMDAT ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE = 33554432 #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE = 536870912 #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_READ = 1073741824 #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_READ ideal-int #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_WRITE = 2147483648 #51868
[x] pkg debug/pe, const IMAGE_SCN_MEM_WRITE ideal-int #51868
[x] pkg debug/pe, method (*File) COFFSymbolReadSectionDefAux(int) (*COFFSymbolAuxFormat5, error) #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, Checksum uint32 #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumLineNumbers uint16 #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumRelocs uint16 #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, SecNum uint16 #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, Selection uint8 #51868
[x] pkg debug/pe, type COFFSymbolAuxFormat5 struct, Size uint32 #51868

encoding/binary

[x] pkg encoding/binary, func AppendUvarint([]uint8, uint64) []uint8 #51644
[x] pkg encoding/binary, func AppendVarint([]uint8, int64) []uint8 #51644
[x] pkg encoding/binary, type AppendByteOrder interface { AppendUint16, AppendUint32, AppendUint64, String } #50601
[x] pkg encoding/binary, type AppendByteOrder interface, AppendUint16([]uint8, uint16) []uint8 #50601
[x] pkg encoding/binary, type AppendByteOrder interface, AppendUint32([]uint8, uint32) []uint8 #50601
[x] pkg encoding/binary, type AppendByteOrder interface, AppendUint64([]uint8, uint64) []uint8 #50601
[x] pkg encoding/binary, type AppendByteOrder interface, String() string #50601

encoding/csv

[x] pkg encoding/csv, method (*Reader) InputOffset() int64 #43401

encoding/xml

[x] pkg encoding/xml, method (*Decoder) InputPos() (int, int) #45628

flag

[x] pkg flag, func TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
[x] pkg flag, method (*FlagSet) TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754

fmt

[x] pkg fmt, func Append([]uint8, ...interface{}) []uint8 #47579
[x] pkg fmt, func Appendf([]uint8, string, ...interface{}) []uint8 #47579
[x] pkg fmt, func Appendln([]uint8, ...interface{}) []uint8 #47579

go/doc

[x] pkg go/doc, method (*Package) HTML(string) []uint8 #51082
[x] pkg go/doc, method (*Package) Markdown(string) []uint8 #51082
[x] pkg go/doc, method (*Package) Parser() *comment.Parser #51082
[x] pkg go/doc, method (*Package) Printer() *comment.Printer #51082
[x] pkg go/doc, method (*Package) Synopsis(string) string #51082
[x] pkg go/doc, method (*Package) Text(string) []uint8 #51082

go/doc/comment

[x] pkg go/doc/comment, func DefaultLookupPackage(string) (string, bool) #51082
[x] pkg go/doc/comment, method (*DocLink) DefaultURL(string) string #51082
[x] pkg go/doc/comment, method (*Heading) DefaultID() string #51082
[x] pkg go/doc/comment, method (*List) BlankBefore() bool #51082
[x] pkg go/doc/comment, method (*List) BlankBetween() bool #51082
[x] pkg go/doc/comment, method (*Parser) Parse(string) *Doc #51082
[x] pkg go/doc/comment, method (*Printer) Comment(*Doc) []uint8 #51082
[x] pkg go/doc/comment, method (*Printer) HTML(*Doc) []uint8 #51082
[x] pkg go/doc/comment, method (*Printer) Markdown(*Doc) []uint8 #51082
[x] pkg go/doc/comment, method (*Printer) Text(*Doc) []uint8 #51082
[x] pkg go/doc/comment, type Block interface, unexported methods #51082
[x] pkg go/doc/comment, type Code struct #51082
[x] pkg go/doc/comment, type Code struct, Text string #51082
[x] pkg go/doc/comment, type Doc struct #51082
[x] pkg go/doc/comment, type Doc struct, Content []Block #51082
[x] pkg go/doc/comment, type Doc struct, Links []*LinkDef #51082
[x] pkg go/doc/comment, type DocLink struct #51082
[x] pkg go/doc/comment, type DocLink struct, ImportPath string #51082
[x] pkg go/doc/comment, type DocLink struct, Name string #51082
[x] pkg go/doc/comment, type DocLink struct, Recv string #51082
[x] pkg go/doc/comment, type DocLink struct, Text []Text #51082
[x] pkg go/doc/comment, type Heading struct #51082
[x] pkg go/doc/comment, type Heading struct, Text []Text #51082
[x] pkg go/doc/comment, type Italic string #51082
[x] pkg go/doc/comment, type Link struct #51082
[x] pkg go/doc/comment, type Link struct, Auto bool #51082
[x] pkg go/doc/comment, type Link struct, Text []Text #51082
[x] pkg go/doc/comment, type Link struct, URL string #51082
[x] pkg go/doc/comment, type LinkDef struct #51082
[x] pkg go/doc/comment, type LinkDef struct, Text string #51082
[x] pkg go/doc/comment, type LinkDef struct, URL string #51082
[x] pkg go/doc/comment, type LinkDef struct, Used bool #51082
[x] pkg go/doc/comment, type List struct #51082
[x] pkg go/doc/comment, type List struct, ForceBlankBefore bool #51082
[x] pkg go/doc/comment, type List struct, ForceBlankBetween bool #51082
[x] pkg go/doc/comment, type List struct, Items []*ListItem #51082
[x] pkg go/doc/comment, type ListItem struct #51082
[x] pkg go/doc/comment, type ListItem struct, Content []Block #51082
[x] pkg go/doc/comment, type ListItem struct, Number string #51082
[x] pkg go/doc/comment, type Paragraph struct #51082
[x] pkg go/doc/comment, type Paragraph struct, Text []Text #51082
[x] pkg go/doc/comment, type Parser struct #51082
[x] pkg go/doc/comment, type Parser struct, LookupPackage func(string) (string, bool) #51082
[x] pkg go/doc/comment, type Parser struct, LookupSym func(string, string) bool #51082
[x] pkg go/doc/comment, type Parser struct, Words map[string]string #51082
[x] pkg go/doc/comment, type Plain string #51082
[x] pkg go/doc/comment, type Printer struct #51082
[x] pkg go/doc/comment, type Printer struct, DocLinkBaseURL string #51082
[x] pkg go/doc/comment, type Printer struct, DocLinkURL func(*DocLink) string #51082
[x] pkg go/doc/comment, type Printer struct, HeadingID func(*Heading) string #51082
[x] pkg go/doc/comment, type Printer struct, HeadingLevel int #51082
[x] pkg go/doc/comment, type Printer struct, TextCodePrefix string #51082
[x] pkg go/doc/comment, type Printer struct, TextPrefix string #51082
[x] pkg go/doc/comment, type Printer struct, TextWidth int #51082
[x] pkg go/doc/comment, type Text interface, unexported methods #51082

go/types

[x] pkg go/types, method (*Func) Origin() *Func #51682
[x] pkg go/types, method (*Var) Origin() *Var #51682

hash/maphash

[x] pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
[x] pkg hash/maphash, func String(Seed, string) uint64 #42710

html/template

[x] pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
[x] pkg html/template, type FuncMap = template.FuncMap #46121

net/http

[x] pkg net/http, method (*MaxBytesError) Error() string #30715
[x] pkg net/http, type MaxBytesError struct #30715
[x] pkg net/http, type MaxBytesError struct, Limit int64 #30715

net/url

[x] pkg net/url, func JoinPath(string, ...string) (string, error) #47005
[x] pkg net/url, method (*URL) JoinPath(...string) *URL #47005
[x] pkg net/url, type URL struct, OmitHost bool #46059

os/exec

[x] pkg os/exec, method (*Cmd) Environ() []string #50599
[x] pkg os/exec, type Cmd struct, Err error #43724
[x] pkg os/exec, var ErrDot error #43724

regexp/syntax

[x] pkg regexp/syntax, const ErrNestingDepth = "expression nests too deeply" #51684
[x] pkg regexp/syntax, const ErrNestingDepth ErrorCode #51684

runtime/debug

[x] pkg runtime/debug, func SetMemoryLimit(int64) int64 #48409

sort

[x] pkg sort, func Find(int, func(int) int) (int, bool) #50340

sync/atomic

[x] pkg sync/atomic, method (*Bool) CompareAndSwap(bool, bool) bool #50860
[x] pkg sync/atomic, method (*Bool) Load() bool #50860
[x] pkg sync/atomic, method (*Bool) Store(bool) #50860
[x] pkg sync/atomic, method (*Bool) Swap(bool) bool #50860
[x] pkg sync/atomic, method (*Int32) Add(int32) int32 #50860
[x] pkg sync/atomic, method (*Int32) CompareAndSwap(int32, int32) bool #50860
[x] pkg sync/atomic, method (*Int32) Load() int32 #50860
[x] pkg sync/atomic, method (*Int32) Store(int32) #50860
[x] pkg sync/atomic, method (*Int32) Swap(int32) int32 #50860
[x] pkg sync/atomic, method (*Int64) Add(int64) int64 #50860
[x] pkg sync/atomic, method (*Int64) CompareAndSwap(int64, int64) bool #50860
[x] pkg sync/atomic, method (*Int64) Load() int64 #50860
[x] pkg sync/atomic, method (*Int64) Store(int64) #50860
[x] pkg sync/atomic, method (*Int64) Swap(int64) int64 #50860
[x] pkg sync/atomic, method (Pointer[$0]) CompareAndSwap($0, *$0) bool #50860
[x] pkg sync/atomic, method (*Pointer[$0]) Load() *$0 #50860
[x] pkg sync/atomic, method (Pointer[$0]) Store($0) #50860
[x] pkg sync/atomic, method (Pointer[$0]) Swap($0) *$0 #50860
[x] pkg sync/atomic, method (*Uint32) Add(uint32) uint32 #50860
[x] pkg sync/atomic, method (*Uint32) CompareAndSwap(uint32, uint32) bool #50860
[x] pkg sync/atomic, method (*Uint32) Load() uint32 #50860
[x] pkg sync/atomic, method (*Uint32) Store(uint32) #50860
[x] pkg sync/atomic, method (*Uint32) Swap(uint32) uint32 #50860
[x] pkg sync/atomic, method (*Uint64) Add(uint64) uint64 #50860
[x] pkg sync/atomic, method (*Uint64) CompareAndSwap(uint64, uint64) bool #50860
[x] pkg sync/atomic, method (*Uint64) Load() uint64 #50860
[x] pkg sync/atomic, method (*Uint64) Store(uint64) #50860
[x] pkg sync/atomic, method (*Uint64) Swap(uint64) uint64 #50860
[x] pkg sync/atomic, method (*Uintptr) Add(uintptr) uintptr #50860
[x] pkg sync/atomic, method (*Uintptr) CompareAndSwap(uintptr, uintptr) bool #50860
[x] pkg sync/atomic, method (*Uintptr) Load() uintptr #50860
[x] pkg sync/atomic, method (*Uintptr) Store(uintptr) #50860
[x] pkg sync/atomic, method (*Uintptr) Swap(uintptr) uintptr #50860
[x] pkg sync/atomic, type Bool struct #50860
[x] pkg sync/atomic, type Int32 struct #50860
[x] pkg sync/atomic, type Int64 struct #50860
[x] pkg sync/atomic, type Pointer[$0 interface{}] struct #50860
[x] pkg sync/atomic, type Uint32 struct #50860
[x] pkg sync/atomic, type Uint64 struct #50860
[x] pkg sync/atomic, type Uintptr struct #50860

time

[x] pkg time, method (Duration) Abs() Duration #51414
[x] pkg time, method (Time) ZoneBounds() (Time, Time) #50062

The issue number was wrong for the debug/pe changes, probably my fault creating the initial file set. Sent https://go.dev/cl/414515 to fix.
There are a few unexpected API additions attributed to #50674. I will look more closely at those.
Everything else is as proposed and accepted.

The new fields for #50674 look fine but they are undocumented
(https://go-review.googlesource.com/c/go/+/390834/6/src/crypto/x509/x509.go#2081).
I will ask Roland to add docs and then this issue can be closed.

CL 414635 updates the comment. Once it is in we can close this issue.

CL 414635 is in. Thank you, closing as done.
(I've also checked off the last 3 boxes so it's clear we didn't accidentally miss them. They corresponded to the 3 more fields for #50674, which Russ said was fine, no objections in https://github.com/golang/go/issues/50674#issuecomment-1167955187, and they're now documented.)

authors: cherrymui dmitshur rsc


text:
cmd/compile: Prove fails bce when taking the division of length as index

What version of Go are you using (go version)?

$ go version
go version go1.19.3 linux/amd64

Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/magnus/.cache/go-build"
GOENV="/home/magnus/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/magnus/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/magnus/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/magnus/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1748103025=/tmp/go-build -gno-record-gcc-switches"

What did you do?
I took the length of an object, to split it into halves, and there were IsSliceInBounds checks
What did you expect to see?
The IsSliceInBounds checks eliminatied
What did you see instead?
They were not eliminated
Short program showing issue
package main

func SplitInHalf(s []int) (left, right []int) {
	middle := len(s) / 2
	left = s[:middle]
	right = s[middle:]
	return
}

func main() {}

$ go build -gcflags="-d=ssa/check_bce/debug=1" main.go
command-line-arguments
./main.go:5:10: Found IsSliceInBounds
./main.go:6:11: Found IsSliceInBounds

This is a correct behavior. See https://github.com/golang/go/issues/16595

Ah, it looks this is a different problem.
What about the length of s is zero?

I've seen your:

[update] Sorry, the bounds should be eliminated here.

But I'm responding anyway for posterity and future readers. :)

This is a correct behavior. See https://github.com/golang/go/issues/16595
Also see the "Example 3" section in https://go101.org/article/bounds-check-elimination.html

Thoses examples you linked are different, they incorrectly assume that slice[:i] should prove slice[i:].
This is wrong because go use [x,y) ranging, that means :i is one past the index that will be taken, while i: is the last index that will be taken. In other words i <= cap(slice) does not prove i < cap(slice).
Here we have a different issue, actually it reproduce just like this without this double left / right reslicing:
func SplitInHalfRight(s []int) (right []int) {
	middle := len(s) / 2
	right = s[middle:]
	return
}

It should BCE but it doesn't, hopefully this can convaince you, if we feed a 0 length slice in the original function we will get this after folding out all constants:

func SplitInHalf(s []int) (left, right []int) {
	middle := len(s) / 2 // 0 / 2 = 0
	left = s[:middle] // []int{}[0:0] -> []int{}
	right = s[middle:] // []int{}[0:0] -> []int{}
	return
}

In other words feeding an empty produce two empty slices.

This was easy to fix, I just had to teach the compiler that for unsigned divisions z := x / y and unsigned right shifts (which are really just divisions by powers of two) z := x >> y, z is always smaller are equal to x.


text:
internal/hiddenfile: suggest new package to check if a file is hidden in the runtime os

Internal Library for Handling Hidden Files in Go
Abstract
This proposal suggests the creation of an internal library in the Go source code to handle hidden files, including the ability to determine if a file is hidden on both Windows and Unix-like systems. The library aims to provide a unified and consistent way of dealing with hidden files, abstracting away the platform-specific differences.
Motivation
Currently, the Go tests in the official repository include special conditions to handle hidden files like .ini on Windows and .DS_Store on macOS. This approach adds platform-specific code and makes the tests less maintainable and harder to understand. By introducing an internal library, we can provide a common API for detecting hidden files across different platforms, promoting code reuse and improving test code quality.
Proposal

Create a new internal package, e.g., internal/hiddenfile, in the Go source code repository.
Implement functions like IsHidden(path string) bool and IsHiddenFileInfo(info os.FileInfo) bool to determine if a file is hidden.
Use os-independent functions to handle hidden files on Windows and Unix-like systems using go directives i.e go:build darwin.
Provide appropriate documentation and examples to guide developers on using the internal library effectively.
Ensure the library is properly tested on different platforms and that test coverage is maintained.
Consider potential performance implications and optimize the implementation if necessary.

Compatibility
This proposal aims to be backward compatible with existing code and does not introduce any breaking changes to the Go programming language or standard library.
Rationale
By creating an internal library for handling hidden files, we can consolidate the logic for detecting hidden files in one central location. This improves code readability, reduces duplication, and simplifies maintenance. Additionally, having a standardized way of handling hidden files makes it easier for developers to write portable code that works across different operating systems.
Open Issues
There are no known open issues at this time.
Conclusion
The proposed internal library for handling hidden files in Go will provide a consistent and unified approach to dealing with hidden files across different platforms. By abstracting away platform-specific details, we can improve the maintainability, readability, and portability of Go code.
Relates to #60664
Gerrit PR: https://go-review.googlesource.com/c/go/+/501635
Original Proposed By @bcmills

It sounds like you are suggesting a new internal package for detecting hidden files.  If this is an internal package, it does not contain any user visible API.  As such, it does not need to go through the proposal process.

CC @bcmills

@ianlancetaylor i didn't realize it.

@ianlancetaylor i didn't realize internal apis doesn't need proposal process..

authors: Nasfame ianlancetaylor


text:
”go build -race ./...“ Causing the program to not run correctly

What version of Go are you using (go version)?

$ go version 1.21.3

Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xiachongshang\AppData\Local\go-build
set GOENV=C:\Users\xiachongshang\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\gopath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\gopath
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.3
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set GOWORK=E:\goworks\gobige-demo\go.work
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\xiachongshang\AppData\Local\Temp\go-build912284024=/tmp/go-build -gno-record-gcc-switches

What did you do?
package main
import "fmt"
func main() {
fmt.Println("abc")
}
directory structure
-gatetest
-- Lobby
---main.go
--go.mod
cmd:
go build -race ./...
.\Lobby.exe
What did you expect to see?
See output：
abc
What did you see instead?
nothing in the world.

did you not get a executable or not get any output from the executable (and did it exit)?

Could not reproduce on Darwin.
Could not reproduce on a teetering stack of virtualization with windows-amd64 Go and gcc perched on top.
I think we need more information.

gatewtest.zip

@dr2chase

@bcmills @dr2chase @seankhliao @evanphx

@seankhliao What information is missing?


text:
cmd/link: regression on building an app with GOOS=wasip1 GOARCH=wasm

Go version
go version go1.22.0 darwin/arm64
Output of go env in your module/workspace:
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/haribala/Library/Caches/go-build'
GOENV='/Users/haribala/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/haribala/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/haribala/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.0/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.0/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/81/pzmd85sj2d9dg02xgmd7wlhr0000gn/T/go-build1347662950=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?
This is a wasm app that builds with GOOS=wasip1 and GOARCH=wasm
Steps to reproduce:

Clone the wasm branch latest commit https://github.com/konveyor/move2kube/tree/6173004d80d1e21592374b54362f3d9a13ab3de5

Use the docker container to build using different versions of the Go compiler

Using version 1.21.6 the build is successful

$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21.6 bash
Unable to find image 'golang:1.21.6' locally
1.21.6: Pulling from library/golang
66932e2b787d: Pull complete
4afa7e263db1: Pull complete
c812910e5e62: Pull complete
f0415bb1783d: Pull complete
d7276b11ada4: Pull complete
19aeecab7f9b: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:7b575fe0d9c2e01553b04d9de8ffea6d35ca3ab3380d2a8db2acc8f0f1519a53
Status: Downloaded newer image for golang:1.21.6
root@4b191bbc5fed:/usr/src/myapp# go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/usr/src/myapp/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4290207339=/tmp/go-build -gno-record-gcc-switches'
root@e9f3aa0a9ee8:/usr/src/myapp# ls
LICENSE   README.md  bin  collector  environment  go.mod  graph  m2k-web-ui  qaengine  transformer
Makefile  assets     cmd  common     filesystem   go.sum  lib	 main.go     scripts   types
root@e9f3aa0a9ee8:/usr/src/myapp# make build
mkdir -p "./bin"
CGO_ENABLED=0 GOOS=wasip1 GOARCH=wasm go build -ldflags '-X github.com/konveyor/move2kube-wasm/types/info.buildmetadata=unreleased -X github.com/konveyor/move2kube-wasm/types/info.gitCommit=6173004d80d1e21592374b54362f3d9a13ab3de5 -X github.com/konveyor/move2kube-wasm/types/info.gitTreeState=clean' -o "./bin/move2kube.wasm" .
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/docker/docker v24.0.0+incompatible
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/spf13/cast v1.5.1
go: downloading golang.org/x/crypto v0.12.0
go: downloading golang.org/x/text v0.12.0
go: downloading k8s.io/apimachinery v0.23.1
go: downloading github.com/gorilla/mux v1.8.0
go: downloading github.com/mholt/archiver/v3 v3.5.1
go: downloading github.com/spf13/cobra v1.7.0
go: downloading github.com/spf13/viper v1.16.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.13
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/google/gofuzz v1.2.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading k8s.io/klog/v2 v2.100.1
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.3
go: downloading github.com/andybalholm/brotli v1.0.3
go: downloading github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/klauspost/compress v1.16.5
go: downloading github.com/klauspost/pgzip v1.2.5
go: downloading github.com/nwaples/rardecode v1.1.0
go: downloading github.com/pierrec/lz4/v4 v4.1.2
go: downloading github.com/ulikunitz/xz v0.5.9
go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading github.com/jilleJr/afero v1.9.6-0.20230808154115-904d2897c961
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading k8s.io/utils v0.0.0-20230505201702-9f6742963106
go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
go: downloading github.com/Masterminds/semver/v3 v3.1.1
go: downloading github.com/cloudfoundry-community/go-cfclient/v2 v2.0.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading k8s.io/client-go v0.23.1
go: downloading github.com/mikefarah/yq/v4 v4.16.2
go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
go: downloading github.com/go-logr/logr v1.2.4
go: downloading github.com/json-iterator/go v1.1.12
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/subosito/gotenv v1.4.2
go: downloading github.com/magiconair/properties v1.8.7
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading golang.org/x/net v0.14.0
go: downloading golang.org/x/oauth2 v0.7.0
go: downloading k8s.io/api v0.23.1
go: downloading k8s.io/kubernetes v1.23.1
go: downloading knative.dev/serving v0.31.0
go: downloading github.com/golang/protobuf v1.5.3
go: downloading github.com/googleapis/gnostic v0.5.5
go: downloading golang.org/x/term v0.11.0
go: downloading github.com/moby/buildkit v0.9.3
go: downloading github.com/Akash-Nayak/GopacheConfig v0.0.0-20210730101443-d5bfa3109be4
go: downloading github.com/BurntSushi/toml v1.0.0
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading github.com/joho/godotenv v1.4.0
go: downloading golang.org/x/mod v0.10.0
go: downloading github.com/elliotchance/orderedmap v1.4.0
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/goccy/go-yaml v1.9.4
go: downloading github.com/jinzhu/copier v0.3.4
go: downloading github.com/timtadh/lexmachine v0.2.2
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/docker/go-units v0.4.0
go: downloading github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198
go: downloading github.com/docker/cli v0.0.0-20200210162036-a4bedce16568
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/openshift/api v0.0.0-20220112145620-704957ce4980
go: downloading github.com/whilp/git-urls v1.0.0
go: downloading knative.dev/networking v0.0.0-20220412163509-1145ec58c8be
go: downloading knative.dev/pkg v0.0.0-20220412134708-e325df66cb51
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading k8s.io/apiserver v0.23.1
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading golang.org/x/time v0.1.0
go: downloading k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
go: downloading github.com/opencontainers/go-digest v1.0.0
go: downloading github.com/containerd/typeurl v1.0.2
go: downloading github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387
go: downloading github.com/timtadh/data-structures v0.5.3
go: downloading k8s.io/component-base v0.23.1
go: downloading github.com/docker/distribution v2.8.0+incompatible
go: downloading golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
go: downloading github.com/docker/docker-credential-helpers v0.7.0
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading gomodules.xyz/jsonpatch/v2 v2.2.0
go: downloading go.uber.org/atomic v1.9.0
go: downloading go.uber.org/zap v1.21.0
go: downloading golang.org/x/sys v0.11.0
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/blendle/zapdriver v1.3.1
go: downloading go.uber.org/multierr v1.8.0
gzip -f "./bin/move2kube.wasm"
# We have to put require github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
# in order for logrus to work. See https://github.com/HarikrishnanBalagopal/test-wasi-fs-browser/tree/main
# CGO_ENABLED=0 tinygo build -o "./bin/move2kube.wasm" -target=wasi .
root@e9f3aa0a9ee8:/usr/src/myapp# echo $?
0
# ls bin/
move2kube  move2kube.wasm.gz

Build using version 1.22.0

$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.22.0 bash
Unable to find image 'golang:1.22.0' locally
1.22.0: Pulling from library/golang
c2964e85ea54: Pull complete
d3436c315a5d: Pull complete
603ae72c83b1: Pull complete
a23d83702b67: Pull complete
b64f8be2f560: Pull complete
056502cbc32b: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:7b297d9abee021bab9046e492506b3c2da8a3722cbf301653186545ecc1e00bb
Status: Downloaded newer image for golang:1.22.0
root@3a4e59aed3db:/usr/src/myapp# go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/usr/src/myapp/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3154462467=/tmp/go-build -gno-record-gcc-switches'
root@3a4e59aed3db:/usr/src/myapp# make build
mkdir -p "./bin"
CGO_ENABLED=0 GOOS=wasip1 GOARCH=wasm go build -ldflags '-X github.com/konveyor/move2kube-wasm/types/info.buildmetadata=unreleased -X github.com/konveyor/move2kube-wasm/types/info.gitCommit=6173004d80d1e21592374b54362f3d9a13ab3de5 -X github.com/konveyor/move2kube-wasm/types/info.gitTreeState=clean' -o "./bin/move2kube.wasm" .
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/docker/docker v24.0.0+incompatible
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/spf13/cast v1.5.1
go: downloading golang.org/x/crypto v0.12.0
go: downloading golang.org/x/text v0.12.0
go: downloading k8s.io/apimachinery v0.23.1
go: downloading github.com/gorilla/mux v1.8.0
go: downloading github.com/mholt/archiver/v3 v3.5.1
go: downloading github.com/spf13/cobra v1.7.0
go: downloading github.com/spf13/viper v1.16.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.13
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/google/gofuzz v1.2.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading k8s.io/klog/v2 v2.100.1
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.3
go: downloading github.com/andybalholm/brotli v1.0.3
go: downloading github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/klauspost/compress v1.16.5
go: downloading github.com/klauspost/pgzip v1.2.5
go: downloading github.com/nwaples/rardecode v1.1.0
go: downloading github.com/pierrec/lz4/v4 v4.1.2
go: downloading github.com/ulikunitz/xz v0.5.9
go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading github.com/jilleJr/afero v1.9.6-0.20230808154115-904d2897c961
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading k8s.io/utils v0.0.0-20230505201702-9f6742963106
go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
go: downloading github.com/Masterminds/semver/v3 v3.1.1
go: downloading github.com/cloudfoundry-community/go-cfclient/v2 v2.0.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading k8s.io/client-go v0.23.1
go: downloading github.com/mikefarah/yq/v4 v4.16.2
go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
go: downloading github.com/go-logr/logr v1.2.4
go: downloading github.com/json-iterator/go v1.1.12
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading github.com/subosito/gotenv v1.4.2
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.7
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading golang.org/x/net v0.14.0
go: downloading golang.org/x/oauth2 v0.7.0
go: downloading k8s.io/api v0.23.1
go: downloading k8s.io/kubernetes v1.23.1
go: downloading knative.dev/serving v0.31.0
go: downloading github.com/googleapis/gnostic v0.5.5
go: downloading github.com/golang/protobuf v1.5.3
go: downloading golang.org/x/term v0.11.0
go: downloading github.com/moby/buildkit v0.9.3
go: downloading github.com/Akash-Nayak/GopacheConfig v0.0.0-20210730101443-d5bfa3109be4
go: downloading github.com/BurntSushi/toml v1.0.0
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading github.com/joho/godotenv v1.4.0
go: downloading golang.org/x/mod v0.10.0
go: downloading github.com/elliotchance/orderedmap v1.4.0
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/goccy/go-yaml v1.9.4
go: downloading github.com/jinzhu/copier v0.3.4
go: downloading github.com/timtadh/lexmachine v0.2.2
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/docker/go-units v0.4.0
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198
go: downloading github.com/docker/cli v0.0.0-20200210162036-a4bedce16568
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/openshift/api v0.0.0-20220112145620-704957ce4980
go: downloading github.com/whilp/git-urls v1.0.0
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading knative.dev/networking v0.0.0-20220412163509-1145ec58c8be
go: downloading knative.dev/pkg v0.0.0-20220412134708-e325df66cb51
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading k8s.io/apiserver v0.23.1
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading golang.org/x/time v0.1.0
go: downloading k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
go: downloading github.com/opencontainers/go-digest v1.0.0
go: downloading github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387
go: downloading github.com/containerd/typeurl v1.0.2
go: downloading golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
go: downloading k8s.io/component-base v0.23.1
go: downloading github.com/docker/distribution v2.8.0+incompatible
go: downloading github.com/timtadh/data-structures v0.5.3
go: downloading github.com/docker/docker-credential-helpers v0.7.0
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading gomodules.xyz/jsonpatch/v2 v2.2.0
go: downloading go.uber.org/atomic v1.9.0
go: downloading go.uber.org/zap v1.21.0
go: downloading golang.org/x/sys v0.11.0
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/blendle/zapdriver v1.3.1
go: downloading go.uber.org/multierr v1.8.0
# github.com/konveyor/move2kube-wasm
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Close is too big: 0x100010000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Close is too big: 0x100010000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Match is too big: 0x100030000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Match is too big: 0x100030000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Read is too big: 0x100050000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Read is too big: 0x100050000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Write is too big: 0x100070000
type:*github.com/mholt/archiver/v3.TarBz2: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarBz2).Write is too big: 0x100070000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).CheckPath is too big: 0x100090000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).CheckPath is too big: 0x100090000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Close is too big: 0x1000b0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Close is too big: 0x1000b0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Match is too big: 0x1000d0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Match is too big: 0x1000d0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Read is too big: 0x1000f0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Read is too big: 0x1000f0000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Write is too big: 0x100110000
type:*github.com/mholt/archiver/v3.TarGz: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarGz).Write is too big: 0x100110000
type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).CheckPath is too big: 0x100130000
type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).CheckPath is too big: 0x100130000
type:*github.com/mholt/archiver/v3.TarLz4: non-pc-relative relocation address for github.com/mholt/archiver/v3.(*TarLz4).Close is too big: 0x100150000
/usr/local/go/pkg/tool/linux_arm64/link: too many errors
make: *** [Makefile:45: build] Error 1
root@3a4e59aed3db:/usr/src/myapp# echo $?
2

What did you see happen?
Build succeeds with v1.21.6 but fails with v1.22.0
What did you expect to see?
Build should succeed with v1.22.0 as well

Hmmm, I'm not sure if this is really a regression. It seems to be the same issue as #64856. I think we added some more functions in 1.22 and it made so now it is crossing the 2^16 limit more easily.
cc @golang/wasm @golang/compiler

Duplicate of #64856.

authors: HarikrishnanBalagopal mauri870 thanm


text:
jsonpb: make Marshal and Unmarshal use []byte directly

Hello,
Currently we are required to instantiate a Marhaler/UnMarshaler object. The more notable one of these objects is the Marshaler. A simpler interface may be to create a DefaultMarshal method in this package which marshals a protobuf buffer into a byte array keeping this usage more aligned to the standard library? My current assumption is that we instantiate in order to hold configuration state in the Marshaler object - if this is not the case then my understand is not correct and this may not be feasible.

Bump!

@dsnet I was going to attempt a PR to add new mthods but i noticed you tagged it as pending-v2. Should I hold off?

@ldelossa, yes please. This is new API is already implemented in v2.

@dsnet when will the v2 be released?

The next major revision has been released. See the protojson package.

authors: MeNsaaH Sytten dsnet ldelossa

repo: golang/protobuf

license_source: bigquery


text:
tour: [REPLACE WITH SHORT DESCRIPTION]

Context: https://tour.golang.org/flowcontrol/2
code:
package main
import "fmt"
func main() {
sum := 1
for ; sum < 1000; {
sum += sum
}
fmt.Println(sum)
}
why the result is 1024,firstly sum is 1,one loop sum become to 2,because condition is sum less than 1000 ,so at least 1000 loop ,and finally sum must to larger than 1024

It goes 1, 2, 4, 8, .. 512, 1024, and then it stops because it's > 1000.

authors: ALTree wednesAI

repo: golang/tour


text:
tour: [REPLACE WITH SHORT DESCRIPTION]

Context: http://127.0.0.1:3999/tour/generics/1
Change the title above to describe your issue and add your feedback here, including code if necessary
example
./prog.go:6:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
./prog.go:6:14: undeclared name: comparable (requires version go1.18 or later)
./prog.go:10:6: invalid operation: v == x (type parameter T is not comparable with ==)
./prog.go:20:19: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
./prog.go:24:19: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
How can I check go.mod?

$  go version
go version go1.18.1 linux/amd64

I would guess you are running an old (over a year) version of the offline tour binary.
Perhaps try reinstalling the latest?
go install golang.org/x/website/tour@latest


text:
stat: don't adjust unobserved bins in ROC

Please take a look.
Fixes #1557.
/cc @zhongsigang

Codecov Report

Merging #1558 (321a87e) into master (a513de6) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1558   +/-   ##
=======================================
  Coverage   72.66%   72.66%
=======================================
  Files         481      481
  Lines       57925    57920    -5
=======================================
- Hits        42092    42090    -2
+ Misses      13434    13429    -5
- Partials     2399     2401    +2

Impacted Files
Coverage Δ

stat/roc.go
81.13% <ø> (ø)

graph/flow/control_flow_lt.go
87.50% <0.00%> (-8.93%)
:arrow_down:

optimize/listsearch.go
72.22% <0.00%> (-1.86%)
:arrow_down:

graph/formats/rdf/kind_string.go
0.00% <0.00%> (ø)

graph/flow/control_flow_slt.go
97.22% <0.00%> (+5.55%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a513de6...321a87e. Read the comment docs.

Closing in favour of #1561.

source: gharchive/pull-request

authors: codecov-io kortschak

repo: gonum/gonum


text:
lapack/gonum: clean up Dlanhs and its test

Please take a look.
@soypat

Codecov Report
Patch coverage: 62.50% and project coverage change: -0.11% :warning:

Comparison is base (b79b9f7) 74.00% compared to head (0e544da) 73.89%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1896      +/-   ##
==========================================
- Coverage   74.00%   73.89%   -0.11%
==========================================
  Files         527      511      -16
  Lines       63243    62811     -432
==========================================
- Hits        46801    46417     -384
+ Misses      13864    13832      -32
+ Partials     2578     2562      -16

Files Changed
Coverage Δ

lapack/gonum/dlanhs.go
71.42% <62.50%> (+7.79%)
:arrow_up:

... and 20 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Thank you @vladimir-ch

authors: codecov-commenter soypat vladimir-ch


text:
Sceneform SceneView light

How can I reference the default light of a SceneView?

search for the Sun node ... the official documentation has details about the Sun which is your default light

I did that, i even disable it. For some reason there is still other light that's illuminating the scene.

Sceneform does not currently have a way of disabling or replacing the default light probes, or spherical harmonics which are the source of the lighting that you are seeing.
Would you add some more info on what you're trying to do that requires disabling or replacing the lighting in the scene so we can make sure to consider that as we work on future features to support more customizable lighting?
I'll mark this as a feature request to track adding the ability to customize lighting.

@tpsiaki any progress on this request?

repo: google-ar/sceneform-android-sdk


text:
Fixes #479: tilts each planet in solarsystem sample

Allows setting a tilt axis on Planet to allow tilting each planet. This allows Uranus to look more realistic (by tilting the ring vertically).
To do this, we:

add a counter-orbit rotator, so that the tilt axis always stays facing the same way w.r.t the sun
add an option to tilt RotationNodes

@kenkawakenkenke - thanks again.  Your changes were merged into 1.7

authors: claywilkinson kenkawakenkenke


text:
performance improvement question on multiple models/concurrent execution

Hi Team,
I notice that there are several ways to improve performance such as model pipelining on multiple edge TPUs, model co-compiling technique to avoid alter-eviction on cache. If two models' sizes are small enough to cache on device at the same time, does edgeTPU support concurrent execution on one single edgeTPU?
Another way to think about this is I can design a single model itself that it takes multiple inputs and gives multiple outputs. However, it seems not gaining any benefit and requires 'split' and 'concate' operations. For this case, how costly are those two operations are? And does this design actually yield benefit? (My testing is: multiple input/output model is 2x more slower than single one, which means it is slower than I just execute the later one twice in serial)

some details on my test:
I tried the following model:
input_list = []
conv_list  = []
for i in range(fold):
    input0 = keras.layers.Input(shape=(IN_W, IN_H, IN_C))
    input_list.append(input0)
    conv = Conv2D(filters=OUT_C, kernel_size=(F_W, F_H), strides=(S_W, S_H), activation='linear', weights=[weights], use_bias=False, trainable=False)(input0)
    conv_list.append(conv)
out    = concatenate(conv_list, axis=1)
model = tf.keras.models.Model(inputs=input_list, outputs=[out])
return model

and the edgetpu_compiler (version: 14.1.317412892) gives the error message:
F tensorflow/lite/toco/graph_transformations/quantize.cc:606] Check failed: is_rnn_state_array

Which I don't see why.
And the 'split' and 'concat' version I mentioned is the following:
input0 = keras.layers.Input(shape=(IN_W*fold, IN_H, IN_C))
split  = Lambda(lambda x: tf.split(x, num_or_size_splits=fold, axis=1))(input0)
conv_list = []
for i in range(fold):
    conv0 = Conv2D(filters=OUT_C, kernel_size=(F_W, F_H), strides=(S_W, S_H), activation='linear', weights=[weights], use_bias=False, trainable=False)(split[i])
    conv_list.append(conv0)
out    = concatenate(conv_list, axis=1)
model = tf.keras.models.Model(inputs=[input0], outputs=out)
return model

repo: google-coral/edgetpu


text:
Cancelled Script when flashing

Description
When flashing the dev board I accidentally canceled the bash script (flash.sh) when running. This was the output up to the point of CTRL+C
Have I bricked the dev board?
Click to expand!
Issue Type
Build/Install, Support
Operating System
Ubuntu
Coral Device
Dev Board
Other Devices
No response
Programming Language
No response
Relevant Log Output
Existing home partition detected, will not flash home (override with -H)
target reported max download size of 419430400 bytes
sending 'bootloader0' (1039 KB)...
OKAY [  0.062s]
writing 'bootloader0'...
OKAY [  0.194s]
finished. total time: 0.256s
rebooting into bootloader...
OKAY [  0.018s]
finished. total time: 0.119s
target reported max download size of 419430400 bytes
sending 'gpt' (33 KB)...
OKAY [  0.018s]
writing 'gpt'...
OKAY [  0.223s]
finished. total time: 0.241s
rebooting into bootloader...
OKAY [  0.016s]
finished. total time: 0.116s
erasing 'misc'...
OKAY [  0.043s]
finished. total time: 0.043s
target reported max download size of 419430400 bytes
sending 'boot' (131072 KB)...
OKAY [  6.093s]
writing 'boot'...
`OKAY [  6.244s]
finished. total time: 12.338s
`target reported max download size of 419430400 bytes
sending sparse 'rootfs' 1/4 (408709 KB)...

@ryan-keswick Can you try to flash the dev board with a SDCARD as instructed at https://coral.ai/docs/dev-board/get-started/#flash-the-board ?

@ryan-keswick Were you able to resolve this issue ?

Feel free to reopen if you have any issues with SDCARD flashing.

authors: hjonnala manoj7410 ryan-keswick


text:
Measuring the torque in a joint with sensor?

Hi,
I'm a student and I'm trying to use MuJoCo for sim2real of a gripper.
I'm looking for some help with measuring the torque in a joint.
Here is my question:
I would like to measure the joint torque for the gripper, like what you did in OP3 where you measured the joint torque as a penalty. Did you add a force-torque sensor to the joint or there is a different way of measuring it? Would you mind providing me with a short example or a guide for measuring the torque of a joint? THANKS!

You need to define more accurately what you mean by "torque in a joint". You could mean:

The torque generated by the actuator
The total torque along the joint axis due to the actuator and everything else.
The total 3D torque through the joint, including in axes orthogonal to the joint axis.

Which is it?

Hi, by torque in joint, I’m referring to second point. I would like to measure the torque within the joint due to external force.

What do you mean "external force"? Not including the actuator or including the actuator?

The joint is a position-controlled joint, like the knees' joint of OP3, and I want to monitor the variation of torque generated by the actuator when an external force is applied to the joint in the opposite direction, resisting the movement. So it should include the actuator?
For example, in the paper of the OP3, inside the reward, there is a penalty, equal to the magnitude of the torque measured at the player’s knees. This discourages the player from learning gaits which cause high forces on the knees, for example during ground impacts, which can damage a physical robot.
And, I'm using python.

data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth

Hi i just wornde what the difference bewteen: data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth;
and just put a site to the joint and use torque sensor to read the torque value. I try to plot on axis from the torque sensor and the value calculate from the data.joint, there are different scale, and some time the value are quite different(not only in different scale)

qfrc_smooth

Hi Ziqiao, I found a post somewhat related to your question. Have you figured out?
https://www.roboti.us/forum/index.php?threads/best-way-to-represent-robots-torque-sensors.4181/

Hi i just curiosity whats the difference bewteen: data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth; and just put a site to the joint and use torque sensor to read the torque value. I try to plot on axis from the torque sensor and the value calculate from the data.joint, there are different scale, and some time the value are quite different(not only in different scale)

Hi Ziqiao, I found a post somewhat related to your question. Have you figured out?
https://www.roboti.us/forum/index.php?threads/best-way-to-represent-robots-torque-sensors.4181/

authors: NuCapybara QiyangYan yuvaltassa ziqiao30

repo: google-deepmind/mujoco


text:
Android Basics: Fragments Navigation component

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-fragments-navigation-component?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-fragments-navigation-component#7
In which task and step of the codelab can this issue be found?
task: Fragments and the Navigation Component
step: 8. Using the Navigation Graph
Describe the problem
translate error in Chinese version

Steps to reproduce?

Go to...
Click on...
See error...

Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.

and the attribute called app:navHost is not found


text:
Add Repository

URL of codelab:
https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository#8
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
[9. Write a repository test]
Create an instance of the NetworkMarsPhotosRepository and pass the FakeMarsApiService as the marsApiService parameter.
Describe the problem
Following the codelab from previous steps, it seems that the NetworkMarsPhotosRepository was previously called DefaultMarsPhotosRepository.
In other words, in step 9, is the first time that the word NetworkMarsPhotosRepository is mentioned in the whole codelab
Steps to reproduce?

Go to...
Click on...
See error...

Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.

Duplicate of #34


text:
Android Basics: Viewmodel and State in Compose

@Test
fun gameViewModel_Initialization_FirstWordLoaded() {
    val gameUiState = viewModel.uiState.value
    val unScrambledWord = getUnscrambledWord(gameUiState.currentScrambledWord)

    // Assert that current word is scrambled.
    assertNotEquals(unScrambledWord, gameUiState.currentScrambledWord)
    // Assert that current word count is set to 1.
    assertTrue(gameUiState.currentWordCount == 1)
    // Assert that initially the score is 0.
    assertTrue(gameUiState.score == 0)
    // Assert that the wrong word guessed is false.
    assertFalse(gameUiState.isGuessedWordWrong)
    // Assert that game is not over.
    assertFalse(gameUiState.isGameOver)
}

At the first time the app initialized, currentWordCount should be 0 not 1. Am I wrong?

Yes, you're right. I spotted it, too.  Because init block in GameViewModel calls resetGame(). In this function, a new instance of GameUiState with shuffled word is created for _uiState. So, currentWordCount takes default value, 0. I'm sure this mistake will be fixed, soon.

No, it is not fixed yet.... i just encountered the same issue while testing, and found the solution also by myself and thinking, maybe this fault is on purpose to test our understanding of the function because it is so easy to see?... :-)

@tugceaktepe
@AAB999
@myhency
Could you please check now.
This should have been fixed!

@android-dev-lxl this has not been fixed on the Codelab it still states

Hello @enikebraimoh,
Thank you for reaching out to us. The typo is fixed:

authors: AAB999 android-dev-lxl enikebraimoh myhency osuleymanova tugceaktepe


text:
Add nblint and nbfmt checks to pull requests

These args should work for the cookbook, though there are some KIs:

The button-check looks for a table with class="tfo-notebook-buttons", which we have stripped from cookbook recipes.
Lots of notebooks use "we" in an acceptable way - e.g. as LLM output, but we don't have a way to suppress this check per-cell.
License & copyright checks are disabled. We don't have copyright and licenses headers added to content yet, though we are required to. We should add them before enabling the checks.

We should also set this up so that nbfmt runs and commits automatically too but for now I'm just copying our existing setup.

Added the license/copyright checks back in after #91. Attempting a fix for the first issue in https://github.com/tensorflow/docs/pull/2304

repo: google-gemini/cookbook


text:
Add support for File api

Expected Behavior
The File api is only available in the python sdk: https://ai.google.dev/tutorials/prompting_with_media
Actual Behavior
To upload file in js sdk and use it with gemini-1.5-pro
Steps to Reproduce the Problem
none, this is a feature quest
Specifications

Version: 0.5.0
Platform: web

This implementation is in progress.

This is released: https://github.com/google-gemini/generative-ai-js/releases
Sample here: https://github.com/google-gemini/generative-ai-js/blob/main/samples/node/file-upload.js
Note you have to import GoogleAIFileManager from a subpath, @google/generative-ai/files, and this is only available for Node environments (not browser).

@hsubox76 It appears that when we upload a large file, the state of the file is still 'PROCESSING' when it is trying to be accessed. I was wondering if there was a way with SSE to get when the state has been updated. I'm trying to do this through the REST API, but it appears that this is what this library is using under the hood, so I assume it is also applicable here.

The only solution right now is polling repeatedly with getFile() (or its REST equivalent) until the state becomes ACTIVE. I know this isn't ideal so feel free to create a feature request issue requesting an improvement on this, with any suggestions you have. Since this applies to the service itself, and is bigger than just one SDK, you can also try posting in https://discuss.ai.google.dev/ for more visibility.

Ah, that's what I feared... thank you nonetheless! Do you have any examples of how I should do this (i.e. polling latency, how long I should poll for before aborting, etc.)?

Unfortunately I don't think we have any official suggestions for polling intervals or for how long to try before giving up. It's a pretty new feature so the documentation is lagging a bit. We should add a simple example of how to poll to the samples just so people know to do it, I'll create an issue to track.

I have a question, Where was the file uploaded? Where can I see it？

It's uploaded somewhere in cloud storage but its not associated with your account thats why we are not charged for the space used.
You can list the files with the API that is the only place you can see them

authors: EvanZhouDev LindaLawton egoist hsubox76 qingfengmy

repo: google-gemini/generative-ai-js


text:
Is it possible to manipulate Google Workspace domains with domain-wide access via Workload Identity Federation?

As the title suggest, I'm wondering the way to access API in Google Workspace domain via Workload Identity Federation?
The service account is already set up and successfully connected Google Workspace, if request is made with downloaded service account key.
I thought delegates input option may be the way to go, but while it gives me the access token, it is not for the Google Workspace API as following message suggests.
panic: failed listing groups: googleapi: Error 404: Domain not found., notFound

I'm not even sure it is possible in the first place, so allow me to raise the issue with blank template.
Thanks in advance!

This is my Code, where GOOGLE_SERVICE_ACCOUNT_CREDENTIALS is either service account key or  credentials_file_path output from google-github-actions/auth
	credInString := os.Getenv("GOOGLE_SERVICE_ACCOUNT_CREDENTIALS")
	ctx := context.Background()
	cred, err := google.CredentialsFromJSONWithParams(ctx, []byte(credInString), google.CredentialsParams{
		Scopes:  scopes,
		Subject: "google-workspace-user@example.com",
	})
	if err != nil {
		panic(fmt.Sprintf("CredentialsFromJSONWithParams: %v", err))
	}

	client := oauth2.NewClient(ctx, cred.TokenSource)

	if adminSrv, err := admin.NewService(ctx, option.WithHTTPClient(client)); err != nil {
		panic(fmt.Sprintf("Unable to initialize admin SDK: %v", err))
	}

Using Web Identity Federation
It fails with an error message suggesting the token is not valid one for the workspace.
Token acquisition seems to be done in multiple steps as sts.googleapis.com issues an intermediate token, and then use it for Service Account Credential API generateAccessToken method.
2021/11/28 18:46:25 <-- 200 https://pipelines.actions.githubusercontent.com/some-kind-of-id-I-though-i-should-hide/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/plan-id/jobs/job-id/idtoken?api-version=2.0&audience=https%3A%2F%2Fiam.googleapis.com%2Fprojects%2Fproject-id%2Flocations%2Fglobal%2FworkloadIdentityPools%2Fsa-account%2Fproviders%2Fgithub-action (168.66ms)
2021/11/28 18:46:25 --> POST https://sts.googleapis.com/v1/token
2021/11/28 18:46:25 <-- 200 https://sts.googleapis.com/v1/token (87.98ms)
2021/11/28 18:46:25 --> POST https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/sa-account@my-project.iam.gserviceaccount.com:generateAccessToken
2021/11/28 18:46:25 <-- 200 https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/sa-account@my-project.iam.gserviceaccount.com:generateAccessToken (59.77ms)
GET /admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false HTTP/1.1
2021/11/28 18:46:25 --> GET https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false
Host: www.googleapis.com
Authorization: ya29.c.KqoDGgjhbll-...(very long one）
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.17.2 gdcl/20200728

2021/11/28 18:46:25 <-- 404 https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false (120.02ms)
2021/11/28 18:46:25 <-- 404 https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false (120.21ms)
panic: failed listing groups: googleapi: Error 404: Domain not found., notFound

Using Service Account (Static) Key
The token acquisition is done via https://oauth2.googleapis.com/token endpoint, and that's it.
The token is valid one and successfully received the response.
2021/11/28 18:20:45 --> POST https://oauth2.googleapis.com/token
2021/11/28 18:20:45 <-- 200 https://oauth2.googleapis.com/token (262.69ms)
GET /admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer ya29.省略
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.17.2 gdcl/20200728

2021/11/28 18:20:45 --> GET https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false
2021/11/28 18:20:45 <-- 200 https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false (495.99ms)
2021/11/28 18:20:45 <-- 200 https://www.googleapis.com/admin/directory/v1/groups?alt=json&customer=my_customer&prettyPrint=false (496.07ms)
6

The default scope is https://googleapis.com/auth/cloud-platform. You'll need to customize the scope (probably to https://www.googleapis.com/auth/admin.directory.domain although I'm not super familiar with that API)

I actually have done that, but both delegates and scopes seems to be only relevant to service accounts of Google Cloud, but not Google Workspace.

Hi @ken5scal - I think you're correct. The Security Token Service (sts.googleapis.com) exchanges temporary credentials for short-lived tokens to access Google Cloud resources. I think this will change in the future, but for now it seems restricted to Google Cloud APIs.

Alright, I did some digging. It's not currently possible to use Domain-Wide Delegation with the IAM Credentials endpoint. I've filed this feature request internally and will update the documentation in this repo in a bit. The root cause is around being able to set a custom Subject field, which is not currently supported in the IAM Credentials endpoint (which this repo uses).
For now, the best I can offer is for you to build and sign your own JWT and use that for authentication:

Use WIF to generate an OAuth token with signJwt permission
Use that OAuth token to call the :signJwt method with a custom JWT payload as linked above on the IAM Credentials endpoint
Exchange that signed JWT for an OAuth token using the /token endpoint
Use that new OAuth token to call the Workspace APIs

@sethvargo Cool, thanks for an investigation.

@ken5scal I added support for DWD in https://github.com/google-github-actions/auth/pull/70 (it just automates the steps I outlined above). I has some caveats documented in the readme, the biggest of which is that you can't have tokens valid > 1hr, even if you set the org policy to allow extension up to 12h.

oh, wow. That's one quick development, and I deeply appreciate it.
Let me try it out!

repo: google-github-actions/auth