sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: doc: freeze "Effective Go"
Labels: Documentation,NeedsDecision

There have been a number of suggestions to change the code inside Effective Go lately. For instance, the comments in https://github.com/golang/go/issues/28773 suggest adding an example that uses strings.Builder. But in fact there are almost no mentions of library functions in the document, so starting with strings.Builder doesn't make much sense.

I may be totally alone here, but I think of the current document called "Effective Go"  (EG) as a bit of a time capsule, a published book if you will.

I think it should be pretty much left alone. The continuing churn of advice and recommendations and cargo culting should not be developed there. I think even though it is old it does a fine job of saying how to write _effective_ Go code. How to write modern, trendy, stylistic, library-aware code is different question.

I think there should be a new document that talks about the libraries (almost totally absent from EG), style (nearly ditto), "best practices" such as the thing about returning concrete types, not interfaces (which requires so many caveats I fail to understand why it's a rule), etc. I fear that if you try to incorporate that into EG several things will happen: It will become much longer; it will be changing constantly; many people will add to it; and it will lose the writing style it has, which is almost entirely mine, and therefore in my voice.

Let's freeze it and start something new and more dynamic and more current.
Repository: TypeScript
Issue: A way to expand mapped types
Labels: Suggestion,In Discussion

I want to be able to expand mapped type in intellisense

Currently, mapped types is displayed directly with the mapper and original type, which is unhelpful as hell

![2018-11-13 12 33 16](https://user-images.githubusercontent.com/2993977/48391169-66989900-e740-11e8-9335-cd70518f74bb.png)

With the ts 2.8 condition type, 
you can write more powerful declaration to map almost everything to correct type for you, 
but the ide simply show it is mapped, 
you don't know what is it actually mapped to.

for example, in the above case, I have a mapper looks like
```ts

type Mapper<T> = {
    [K in keyof T]: 
        T[K] extends {type: SQL_ENUM<infer U>}? U:
        T[K] extends {type: SQL_ENUM<infer U>, allowNull: true}? U | undefined:
        
        T[K] extends {type: typeof Sequelize.DATE, allowNull: true}? Date | undefined:
        T[K] extends {type: typeof Sequelize.DATE}? Date:

        T[K] extends {type: typeof Sequelize.INTEGER, allowNull: true}? number | undefined:
        T[K] extends {type: typeof Sequelize.INTEGER}? number:

        // stop here, fon't let things goes too wrong
        T[K] extends {type: typeof Sequelize.ENUM}? never:

        T[K] extends {type: typeof Sequelize.STRING, allowNull: true}? string | undefined:
        T[K] extends {type: typeof Sequelize.STRING}? string:

        T[K] extends {type: typeof Sequelize.TEXT, allowNull: true}? string | undefined:
        T[K] extends {type: typeof Sequelize.TEXT}? string:

        T[K] extends {type: typeof Sequelize.BOOLEAN, allowNull: true}? boolean | undefined:
        T[K] extends {type: typeof Sequelize.BOOLEAN}? boolean:

        any
}
```

that will transform the decalration to a simple

```ts
interface session {
    token: string,
    userId: string,
    ip: string
}
```

But the ide won't tell you anything, which is quite annoying
Repository: go
Issue: runtime: types are not garbage collected
Labels: Performance,NeedsInvestigation,compiler/runtime

go version devel +644ddaa842 Wed Nov 7 16:12:02 2018 +0000 linux/amd64

Newly created types are not garbage collected, so code which creates types on the fly in response to runtime data can leak memory.

This code prints a large number when it should print zero: https://play.golang.org/p/R6N6IJSzYTD
Repository: vscode
Issue: Feature Request Add favorites
Labels: feature-request,getting-started

Can you add in the Welcome page, a list of favorite projects that the user will set? For example i am working on 3 projects but the recent projects is not helping. I would want to have a panel that i can set my favorites and with a click to open the folder.
Repository: go
Issue: net/http: ServeMux excess locking 
Labels: Performance,NeedsInvestigation

In #25383, a lock contention regression was brought up in `ServeMux`.    I believe this lock contention is still present in the mux, and could be removed.  Making ServeMux have an atomically loaded handler map can help reduce latency of serving at the cost of more expensive mutations. 

A sample CL that fixes this regression is https://go-review.googlesource.com/c/go/+/149377 and shows promising speedups on the benchmarks:

```
$ benchstat /tmp/old.txt  /tmp/new.txt
name                   old time/op    new time/op    delta
ServeMux-12              76.3µs ± 3%    64.0µs ± 7%  -16.14%  (p=0.000 n=30+30)
ServeMux_SkipServe-12    28.4µs ± 2%    19.8µs ± 3%  -30.49%  (p=0.000 n=28+28)

name                   old alloc/op   new alloc/op   delta
ServeMux-12              17.3kB ± 0%    17.3kB ± 0%     ~     (all equal)
ServeMux_SkipServe-12     0.00B          0.00B          ~     (all equal)

name                   old allocs/op  new allocs/op  delta
ServeMux-12                 360 ± 0%       360 ± 0%     ~     (all equal)
ServeMux_SkipServe-12      0.00           0.00          ~     (all equal)
```

However, this change depends on using CompareAndSwap, which is only available for `unsafe.Pointer` values.    The reviewer of the CL expressed that using `unsafe` is unacceptable, though I am not really sure why.   I have previously proposed that `atomic.Value` should gain these methods in #26728, but the proposal was also declined.   

### Options

Thus, there are a few ways forward that I can think of, but need a decision from the Go team:

1.  Accept the use of `unsafe` in `ServeMux`, and gain the extra efficiency.
2.  Accept that there is a valid use case for  `atomic.Value.CompareAndSwap()`, and prioritize it being added as a public (or private) API, and use it instead.
3.  Come up with some other solution to improve the serving speed of ServeMux, that is neither of the above two.
4.  Disagree that performance of the ServeMux matters or is worth optimizing, close the CL, and pay the extra 10us per request.

I feel rather helpless with regards to options 1 and 2.  I have suggested both, but have received differing reasons for why they aren't acceptable from different Go team members.  I'd rather the Go team just pick one of the 4 options above, because the requirements for changing Go are opaque from my POV.   

cc: @bradfitz @rsc
Repository: TypeScript
Issue: Go to definition on @constructor type fails
Labels: Bug,Domain: JSDoc,Domain: Symbol Navigation

**TypeScript Version:**  3.2.0-dev.20181110

**Code**

```js
/** @constructor */
function f() {
    this.x = 0;
}

/** @type {f} */
let x = new f();
```

**Expected behavior:**

Go-to-definition at `f` in `@type {f}` works.

**Actual behavior:**

No definitions returned.
Repository: TypeScript
Issue: Symbol display of namespace-function merged symbol at value use should just mention function
Labels: Bug,Domain: Quick Info

**TypeScript Version:** 3.2.0-dev.20181113

**Code**

See `referencesForMergedDeclarations.ts`

**Expected behavior:**

At the value use of `Foo` in `Foo.bind`, just the function is shown in symbol display.

**Actual behavior:**

It shows `"namespace Foo\nfunction Foo(): void"`.
Repository: TypeScript
Issue: Export a object with comment ,but the comment is missing after build a *.d.ts file
Labels: Suggestion,Revisit,Domain: Comment Emit

I export an object,then I build to a declare file like `index.d.ts`,but the file has no comment about that object.

### Source code
```javascript
//src/cache/index.ts
import * as  localStorage from "./localStorage"
export default {
    /**
     * This is a comment2
     */
    localStorage
}

//src/index.ts
import cache from "./cache/index"
export default {
    /**
     * This is a comment1
     */
    cache
}
```

### Index.d.ts
```javascript 
declare const _default: {
    /**
     * This is a comment1
     */
    cache: {
        localStorage: typeof import("./cache/localStorage");//#### This field's comment is missing ####
    };
};
export default _default;
```
Repository: flutter
Issue: Updating Google Maps options needs a way to fail
Labels: c: new feature,p: maps,package,team-ecosystem,P2,triaged-ecosystem

Right now we try to update the options and always complete the method channel invocation with a success.
We should refactor this a bit and relay update errors back to the Dart side.
Repository: TypeScript
Issue: An index signature parameter type with types extends string or number.
Labels: Suggestion,In Discussion

An_index_signature_parameter_type_must_be_string_or_number_1023:
with this Feature, I can't make this code work:
```typescript
export class Events<ED extends EventsDef, EventName extends keyof ED = keyof ED> {
    private eventMap = new Map<EventName, Event<ED[EventName]>>();

    constructor() {
        new Proxy(this, {
            get: (target, p) => {
                if (p in target) {
                    return target[p];
                } else {
                    this.getEvent(p as EventName);
                }
            }
        })
    }

    private getEvent(eventName: EventName) {
        return this.eventMap.get(eventName) || this.generateEvent(eventName);
    }

    private generateEvent(eventName: EventName) {
        let event = new Event<ED[EventName]>();
        this.eventMap.set(eventName, event);
        return event;
    }

                     // error here
    readonly [eventName: EventName]: Event<ED[EventName]>;
}
```
Repository: kubernetes
Issue: Suspicious breakdown in pod startup time in scalability tests
Labels: kind/bug,sig/scalability,lifecycle/frozen

I've already observed a number cases in scalability tests, where for pod startup-time, the breakdown looks suspicious.
As an example, in this run:
https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-e2e-gce-scale-performance/255/build-log.txt

from looking into 10% worst times, we see that:
```
I1113 02:27:31.355] Nov 13 02:27:31.301: INFO: 10% worst schedule-to-watch latencies: ...  {density-latency-pod-438-8thtq gce-scale-cluster-minion-group-2-4km0 4.881956298s}]
...
I1113 02:27:31.376] Nov 13 02:27:31.324: INFO: 10% worst e2e latencies: ... {density-latency-pod-438-8thtq gce-scale-cluster-minion-group-2-4km0 4.881956298s}]
```

The time for "schedule-to-watch" and "e2e latencies" for different pods are exactly the same (which suggests something is wrong).

The second thing that is a bit suspicious in some cases is that the "watch part" something is relatively long (time from when kubelet reports pod status as running to when test really observes that, even though watch latencies e.g. for scheduler or controller-manager are low). This may or may not be related to some starvation at the test level.

@kubernetes/sig-scalability-bugs @mborsz
Repository: flutter
Issue: Programmatic sign in using a specific email id
Labels: c: new feature,p: google_sign_in,package,team-ecosystem,P3,triaged-ecosystem

Hi,
I have a requirement that I need to run background processing that has to connect to Google Drive and Google Sheets for a set of gmail IDs. I didn't find any place where I could force a Google Signin using a specific gmail ID. In my native Android app, I could do this easily using the snippet below but this does not seem possible in Flutter using this package. Do you have any recommendations? Silent sign in also uses the last logged in gmail id. My requirement is to sign in for a set of gmail ids registered in my app.
```dart
    // Initialize credentials and service object.
    GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(
            this, Arrays.asList(Const.SCOPES))
            .setBackOff(new ExponentialBackOff());

    credential.setSelectedAccount(new Account(gmailid,"com.test.myapp"));
```
Repository: godot
Issue: Reimporting meshes clears MeshInstance materials
Labels: bug,confirmed,topic:import,topic:3d

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:** 89a76f21edcdd41b2e032c69fab6cc8211aecd76
<!-- Specify commit hash if non-official. -->


**OS/device including version:** Windows 10
<!-- Specify GPU model and drivers if graphics-related. -->


**Issue description:**

When importing a .obj mesh and adding it to a MeshInstance, the MeshInstance's `material/*` properties get reset upon reimporting the mesh. Additionally, the editor does not properly update to reflect this, and still displays the old material.

<!-- What happened, and what was expected. -->


**Steps to reproduce:**
1. Open [reflectionbug.zip](https://github.com/godotengine/godot/files/2580958/reflectionbug.zip)
2. See a purple teapot
3. in the "FileSystem" Tab, navigate to res://teapot/teapot2.obj
4. in the "Import" Tab, click reimport
5. The teapot becomes white with a checkerboard texture
6. Select "MeshInstance" (which is the teapot), and set its `material/0` and `material/1` properties to a new SpatialMaterial in the Inspector
7. reimport teapot2.obj again
8. Now, the teapot does **not** become white-with-checkerboard, but stays like after step 6.
9. Check MeshInstance in the Inspector: the materials set in 6. still appear as set.
10. Try to open such a material by clicking on the preview-sphere. The material editor does **not** open, instead you get a popup asking whether to create a new ShaderMaterial or a new SpatialMaterial. Do not do any of this.
11. run the scene: the teapot (which appears white-without-checkerboard, like after 6.) in the editor, looks "white-with-checkerboard" (like after 5., which is just the default material of the obj file) in the running game's camera.

**Expected behaviour:**
After 5., I'd expect the MeshInstance's `material/{0,1}` setting to remain unchanged (and also the appearance of the teapot). Isn't that the MeshInstance's property, and not the Mesh's property?

After 8., I suspect that the materials have been reset again, but the editor wasn't updated accordingly and thus behaves glitchy in 9. and 10. I'd expect it to correctly update the view and the inspector (or to not clear the materials, preferably)

After 11., I'd expect the actual game to behave like shown in the editor.

**Minimal reproduction project:** see above
Repository: vscode
Issue: editor.insertSnippet() messes with indenting of the SnippetString
Labels: help wanted,feature-request,api,snippets

This is a very similar issue to #44200/#57093 but that fix appears to be only being applied to completions, but applying snippets causes the same issues.

Here's a repro:

```ts
vs.workspace.openTextDocument(vs.Uri.parse(`untitled:${os.tmpdir}/a.dart`)).then(async (document) => {

	const originalCode = `main() {
  // code indented with two spaces
}`;
	const editor = await vs.window.showTextDocument(document);
	await editor.edit((eb) => eb.insert(new vs.Position(0, 0), originalCode));

	const startOffset = originalCode.indexOf("// code indented with two spaces");
	const endOffset = originalCode.indexOf("\n}");
	const snippetString = new vs.SnippetString("// new code indented with two spaces\n  // newer code indented with two spaces");

	await editor.insertSnippet(snippetString, new vs.Range(document.positionAt(startOffset), document.positionAt(endOffset)));
});
```

This creates a doc and inserts into it the code:

```dart
main() {
  // code indented with two spaces
}
```

It then applies a snippet string that includes an additional line that is also indented by two spaces. However what you end up with is:

```dart
main() {
  // new code indented with two spaces
    // newer code indented with two spaces
}
```

The inserted line has been re-indented.

Whilst this behaviour may be useful if applying basic hard-coded strings, it's incorrect for language servers that are correctly calculating edits to leave the file indented/formatted correctly (I guess for the same reasons that left to #57093).
Repository: nvm
Issue: install script does not detect if git is installed or not
Labels: needs followup,installing nvm

- Operating system and version:

Ubuntu bionic

- `nvm debug` output:

n/a

- `nvm ls` output:

n/a

- How did you install `nvm`? (e.g. install script in readme, Homebrew):

via the install script, but git **was not** installed

- What steps did you perform?

as mentioned in the doc, but git **was not** installed

- What happened?

```bash
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
=> Downloading nvm as script to '/home/user/.nvm'

=> Appending nvm source string to /home/user/.bashrc
=> Appending bash_completion source string to /home/user/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
```

- What did you expect to happen?

```bash
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
=> Downloading nvm from git to '/home/user/.nvm'
=> Dépôt Git vide initialisé dans /home/user/.nvm/.git/
remote: Enumerating objects: 267, done.
remote: Counting objects: 100% (267/267), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 267 (delta 31), reused 86 (delta 15), pack-reused 0
Réception d'objets: 100% (267/267), 119.47 KiB | 643.00 KiB/s, fait.
Résolution des deltas: 100% (31/31), fait.
Depuis https://github.com/creationix/nvm
 * [nouvelle étiquette] v0.33.11   -> v0.33.11
=> Compressing and cleaning up git repository

=> nvm source string already in /home/user/.bashrc
=> bash_completion source string already in /home/user/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
```

- Is there anything in any of your profile files (`.bashrc`, `.bash_profile`, `.zshrc`, etc) that modifies the `PATH`?

no
Repository: go
Issue: cmd/link: wrong c-archive architecture using GNU binutils ar on  macOS Mojave 10.14.1
Labels: help wanted,NeedsInvestigation

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.2 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kyle/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kyle/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vw/ht92mdqd1f54_c6ys42ltc5c0000gn/T/go-build035928823=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

Following the instructions at https://golang.org/doc/install/source, with the latest 1.11.2 darwin/amd64 Go binary distribution as the bootstrap toolchain:

```
git clone https://go.googlesource.com/go gosrc
cd gosrc
git checkout go1.11.2
cd src
./all.bash
```

### What did you expect to see?

Go project should build successfully.

### What did you see instead?

Error log: https://gist.github.com/DemonWav/8caf4fbdf9642133f53502614a231a24

Issues occur with `##### ../misc/cgo/testcarchive`. I believe the issue is with this line:

`ld: warning: ignoring file pkg/darwin_amd64/libgo.a, file was built for archive which is not the architecture being linked (x86_64): pkg/darwin_amd64/libgo.a`

Since the architecture doesn't match, it doesn't link, and the linker can't find the missing symbols.

If I instead ask for the `386` architecture (`GOARCH=386 ./all.bash`), it builds successfully: https://gist.github.com/DemonWav/533894d4426e6a9dc7cc84cc613ee66d

The host is still recognized as `amd64` in the build log, though.
```
Building packages and commands for host, darwin/amd64.
Building packages and commands for target, darwin/386
```

It appears `libgo` is always compiled as `i386` architecture, even when both host and target are defined as `amd64`, `GOARCH=amd64 GOHOSTARCH=amd64 ./all.bash` gives the same result.

I'm not sure if there's something wrong with my environment or what, but I've asked on Slack and IRC and no one seems to know. I'm sorry if this isn't an issue.
Repository: TypeScript
Issue: Type inference does not work for enums and calculated props  
Labels: Bug

**TypeScript Version:**  3.1.6

Calculated props, Spread operator, Enum keyed types

**Code**

```ts
enum Test {
  param = 'X',
  other = 'Y',
  last = 'Z',
};

type TSomeOtherType = {
  readonly someProp: number;
  readonly orOther: string;
};

type TKeyedByEnum = {
  [key in Test]: TSomeOtherType | null;
};

// const throwsCompilerError: TKeyedByEnum = {
//   [Test.param]: 123,
// };

Object.keys(Test).reduce(
    (acc, key: Test): TKeyedByEnum => {
      const doesntThrow: TKeyedByEnum = {
        ...acc,
        [key]: 123,
      };
      return doesntThrow;
    },
    {} as TKeyedByEnum
);
```

**Expected behavior:**

Typescript compiler throws an error on the object `doesntThrow`.

**Actual behavior:**

There is no typescript error on the object `doesntThrow`. The resulting object of type `TKeyedByEnum` contains values of type `number`.

**Playground Link:** 
http://www.typescriptlang.org/play/#src=enum%20Test%20%7B%0D%0A%20%20param%20%3D%20'X'%2C%0D%0A%20%20other%20%3D%20'Y'%2C%0D%0A%20%20last%20%3D%20'Z'%2C%0D%0A%7D%3B%0D%0A%0D%0Atype%20TSomeOtherType%20%3D%20%7B%0D%0A%20%20readonly%20someProp%3A%20number%3B%0D%0A%20%20readonly%20orOther%3A%20string%3B%0D%0A%7D%3B%0D%0A%0D%0Atype%20TKeyedByEnum%20%3D%20%7B%0D%0A%20%20%5Bkey%20in%20Test%5D%3A%20TSomeOtherType%20%7C%20null%3B%0D%0A%7D%3B%0D%0A%0D%0Aconst%20throwsCompilerError%3A%20TKeyedByEnum%20%3D%20%7B%0D%0A%20%20%5BTest.param%5D%3A%20123%2C%0D%0A%7D%3B%0D%0A%0D%0Aconst%20t%20%3D%20Object.keys(Test).reduce(%0D%0A%20%20%20%20(acc%2C%20key%3A%20Test)%3A%20TKeyedByEnum%20%3D%3E%20%7B%0D%0A%20%20%20%20%20%20const%20doesntThrowCompilerError%3A%20TKeyedByEnum%20%3D%20%7B%0D%0A%20%20%20%20%20%20%20%20...acc%2C%0D%0A%20%20%20%20%20%20%20%20%5Bkey%5D%3A%20123%2C%0D%0A%20%20%20%20%20%20%7D%3B%0D%0A%20%20%20%20%20%20return%20doesntThrowCompilerError%3B%0D%0A%20%20%20%20%7D%2C%0D%0A%20%20%20%20%7B%7D%20as%20TKeyedByEnum%0D%0A)%3B%0D%0A%0D%0Aconsole.log(t)%3B

**Related Issues:** 
https://github.com/Microsoft/TypeScript/issues/27704
Repository: rust
Issue: rustdoc doesn't honor `#![doc(html_no_source)]` across crates
Labels: T-rustdoc,C-bug

There's an attribute you can apply to your crate, `#![doc(html_no_source)]`, that tells rustdoc to not generate `[src]` links or their corresponding files for that crate. However, if a *dependency* of this crate doesn't add this attribute, and then re-exports something from that crate, it will happily generate `[src]` links... to nonexistent pages. We should probably track this flag on a per-crate basis for all dependencies, rather than only looking for it in the active crate.