sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: x/tools/go/packages: Unusably slow when there are packages using cgo in the list
Labels: Performance,GoCommand

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.4 windows/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
set GOARCH=amd64
set GOBIN=
set GOCACHE=&lt;snip&gt;\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=&lt;snip&gt;\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=&lt;snip&gt;\Temp\go-build664130090=/tmp/go-build -gno-record-gcc-switches
</pre></details>

### What did you do?
I tried using a Go tool that uses `golang.org/x/go/tools/packages` under the hood (Specifically [`gogetdoc`](https://github.com/zmb3/gogetdoc/), but many more tools are going to use it in order to support Go modules). Since `packages` unconditionally calls `go list -compiled` ([go/tools/go/packages/golist.go:630](https://github.com/golang/tools/blob/92d8274bd7b8a4c65f24bafe401a029e58392704/go/packages/golist.go#L630)), when there are large cgo modules anywhere on the module list, `packages` will cause them to be compiled, without any caching. This can take a very long time and makes any tool doing so unusably slow.

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

### Steps to reproduce
You need to have ImageMagick available. (See https://github.com/gographics/imagick)

1. Save the following as `main.go` in a new go package directory:
```go
package main

import "gopkg.in/gographics/imagick.v2/imagick"

func main() {
	imagick.Initialize()
}
```

2. `dep init`/`go get`/whatever.
3. `gogetdoc -pos main.go:#87`.

### What did you expect to see?
The tool works fast.

### What did you see instead?
It's extremely slow, to the point of being unusable.

### Related issues
https://github.com/zmb3/gogetdoc/issues/47
https://github.com/Microsoft/vscode-go/issues/667
https://github.com/Microsoft/vscode-go/issues/1025
https://github.com/rogpeppe/godef/issues/103

cc @zmb3 @ramya-rao-a
Repository: gin
Issue: Why gin.Context.Cookie has to do url.QueryUnescape?
Labels: bug


- go version: go1.11.2 darwin/amd64
- gin version (or commit ref): v1.3.0
- operating system: macos/linux

## Description

Gin replace + sign with whitespace (probably) due to url.QueryUnescape. We
need to replace it back to original + sign and then encode to make it back to original value.

The code in question:
https://github.com/gin-gonic/gin/blob/master/context.go#L741

If you look at how `http` package get cookie, it does not unescape the value and return just a string. I would like to know what's the decision to unescape value here.

FYI, it breaks our app, and we need to do a workaround by replacing `" "` (whitespace) back to `+`.
Repository: flutter
Issue: Scrollbars and Safearea on iOS
Labels: platform-ios,framework,a: fidelity,f: scrolling,f: cupertino,good first issue,a: layout,P2,team-ios,triaged-ios

Looking at an iOS native Scrollview (e.g. Safari or Mailbox in Mail) in landscape on an iPhone Xs you will see the following behavior:

* When the notch is on the left, the scrollbar is drawn all the way at the right edge of the screen (the content of the scrollview does not go all the way to the right to avoid potential obtrusion by the round corners)
* When the notch is on the right, the scrollbar is not drawn all the way to the right and instead slightly indented (just like the content) to avoid the notch

I believe I cannot easily replicate this behavior with the `Safearea` and `Scrollbar` widget in Flutter. Either the scrollbar is always (regardless of notch orientation) drawn with a padding from the edge of the screen (and would avoid the notch if the phone is orientated to have the notch on the right) or the scrollbar is always drawn all the way at the screen edge (and thus obstructed by the notch if it happened to be on the right side).
Repository: rust
Issue: Improve error message for struct element borrow by closure
Labels: C-enhancement,A-diagnostics,P-low,A-borrow-checker,T-compiler,D-edition

Consider [this small example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018).

The code:
```rust
struct S { x: f32, y: f32 }

fn main() {
    let mut s = S { x: 1.0, y: 2.0 };
    let eval = |x| {
        x + s.y
    };
    s.x = eval(s.x);
    s.x = eval(s.x);
    println!("{} {}", s.x, s.y);
}
```

The compiler reports:
```
error[E0506]: cannot assign to `s.x` because it is borrowed
 --> src/main.rs:8:5
  |
5 |     let eval = |x| {
  |                --- borrow of `s.x` occurs here
6 |         x + s.y
  |             - borrow occurs due to use in closure
7 |     };
8 |     s.x = eval(s.x);
  |     ^^^^^^^^^^^^^^^ assignment to borrowed `s.x` occurs here
9 |     s.x = eval(s.x);
  |           ---- borrow later used here

error: aborting due to previous error
```

The compiler is correct in that `s` is borrowed by the `eval` closure, so it can't be mutated afterward. However, `s.x` is never borrowed by anything, so the error message is pretty confusing. In particular, "--- borrow of `s.x` occurs here" just looks wrong. I'm not sure whether the compiler is just accidentally pointing at the parameter (which is an ordinary `f32`) or whether it has gotten confused.
Repository: rust
Issue: `--logfile` for libtest doesn't respect `--format`.
Labels: T-dev-tools,A-libtest,C-bug

**Observed behaviour**
When using for example `cargo bench -- -Z unstable-options --format json --logfile bench.json`, `bench.json` has the usual human output format. Stdout prints JSON correctly though.

**Expected behaviour**
I expect to see JSON output in the file, exactly like in stdout.

**Notes**
I know at the moment rust is working on the custom test framework (https://github.com/rust-lang/rust/issues/50297), but other people are still relying on the current features (https://github.com/rust-lang/rust/issues/51924, https://github.com/rust-lang/cargo/issues/5670).
In any case, I think this is a bug, right? Would love to make a PR.

**Rustc**
rustc 1.33.0-nightly (a7be40c65 2018-12-26)
Repository: vue
Issue: Support Array subclassing
Labels: feature request

### Version
2.5.21

### Reproduction link
[https://codepen.io/AmrIKhudair/pen/NevxML](https://codepen.io/AmrIKhudair/pen/NevxML)







### Steps to reproduce
1- create a class extending Array and add a custom method
2- instantiate a new instance of the class and add it to data
3- try to call the method on the instance in the template

### What is expected?
The method is successfully executed

### What is actually happening?
Error not a function

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: flutter
Issue: 【Platform View】Why not abstract and unify AndroidView and UIKitView to a single PlatformView widget?
Labels: c: new feature,engine,customer: crowd,a: platform-views,P2,team-engine,triaged-engine

Currently we need to write some platform specific code if using platform view.

```dart
 if (defaultTargetPlatform == TargetPlatform.android) {
      return AndroidView(...)
  } else if  (defaultTargetPlatform == TargetPlatform.iOS) {
      return UIKitView(...)
}

```
Repository: TypeScript
Issue: Inferred missing properties use resolved generic types rather than staying generic
Labels: Suggestion,Domain: Quick Fixes,Experience Enhancement

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.3.0-dev.20181212

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** declare property generic missing member

**Code**

```ts
class TestClass<T> {
    // Inferred:
    // otherValue: number;
    public constructor(
        public readonly value: T,
    ) { }
}


const foo = new TestClass<number>(1);

foo.otherValue = foo.value;
```

**Expected behavior:**

`Declare property 'otherValue'` should create `otherValue: T;`

**Actual behavior:**

...but it actually creates `otherValue: number`. Whatever generic type from the place you request the missing property be added will be the type of the property.

**Playground Link:** http://www.typescriptlang.org/play/#src=class%20TestClass%3CT%3E%20%7B%0D%0A%20%20%20%20%2F%2F%20Inferred%3A%0D%0A%20%20%20%20%2F%2F%20otherValue%3A%20number%3B%0D%0A%20%20%20%20public%20constructor(%0D%0A%20%20%20%20%20%20%20%20public%20readonly%20value%3A%20T%2C%0D%0A%20%20%20%20)%20%7B%20%7D%0D%0A%7D%0D%0A%0D%0A%0D%0Aconst%20foo%20%3D%20new%20TestClass%3Cnumber%3E(1)%3B%0D%0A%0D%0Afoo.otherValue%20%3D%20foo.value%3B%0D%0A

**Related Issues:** I found a _lot_ of similar bugs but didn't see any that looked related...
Repository: godot
Issue: Update script classes when editor enters focus (for external editors)
Labels: bug,topic:gdscript,topic:editor,confirmed

**Godot version:**
Godot 3.1 alpha 4

**Issue description:**
According to [this Reddit post](https://www.reddit.com/r/godot/comments/a96zu6/better_alternative_to_extend_a_custom_class/), users are becoming confused when script class names defined in an external text editor do not subsequently become active in the editor when the editor comes into focus.

This is happening because the `EditorFileSystem::update_script_classes` method is never called when a file has been modified. The EditorFileSystem is only detecting when files have been added, removed, moved, or renamed. The ScriptEditor must be used directly to save the file in order for the method to be called atm, meaning that users can edit the script in their text editor, but then have to switch back and save the same file with the ScriptEditor just to get the editor to update properly.

Instead, it'd be ideal if we could call the method somewhere else that automatically detects modifications to script files.
Repository: ant-design
Issue: Menu组件在collapse模式下，需要展示一级菜单名；二级菜单和一级菜单title的区分度建议增强
Labels: 💄 Design,Inactive

- [ ] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
我们的产品只能用collapse模式。发现在这个模式下一级菜单有几个问题：
1. 有子菜单的一级菜单，永远不会显示title
2. 无子菜单的一级菜单，其title的浮层 和 有子菜单的展示子菜单的浮层，区分度非常低，容易误操作
3. 无子菜单的主操作是点击，有子菜单的主操作是hover，用户反馈比较蒙逼
4. 子菜单active时，selecte样式（白高亮）也不太明显

示例： https://codesandbox.io/s/antd-reproduction-template-f8e60?file=/package.json

### What does the proposed API look like?
建议一级菜单hover统一出title。点击才出二级菜单（有子菜单）或进入链接（无子菜单），若点击子菜单外的部分，则子菜单导航收起


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: rust
Issue: rustdoc: proposal to tame gutter affordances
Labels: T-rustdoc

I have a few small proposals to reduce the visual clutter of rustdoc pages:

1. Move all toggle buttons to the right. Benefits: consistency (sometimes they are already on the right), and moves element clutter to a part of the page that doesn't have the reader's initial focus.
2. Similarly, move the ⓘ link to the right.
3. On the following doc bits remove toggles completely and show docs unconditionally:
    1. Item description
    2. Enum variant
    3. Struct and trait method descriptions (methods directly on the item,  not foreign)
4. "Smart" disclosure of short declarations. If a declaration is at most a few lines long, show it unconditionally with no toggle. Ditto attributes in declarations. Long declarations like Iterator retain their current undisclosed behavior.
    1. ... alternately: always show ~4 lines and truncate beyond that with `...`
5. On mobile: be a bit more extreme in clutter reduction and remove completely any toggles that default to open.
6. On mobile: for blocks that do have a closed toggle, do not wrap the exposed heading, instead truncate with "..." before the toggle. I _think_ declarations tend to have enough information leftward to make this work well, but I haven't tried it yet. It might be a horrible idea in practice.

Quick 'n Dirty mockups just to give the gist:

![screen shot 2018-12-27 at 11 27 41 pm](https://user-images.githubusercontent.com/4282480/50506976-51e23d00-0a30-11e9-97c3-8dc01a250046.png)

![screen shot 2018-12-27 at 11 27 18 pm](https://user-images.githubusercontent.com/4282480/50506992-60c8ef80-0a30-11e9-8444-9fed85fa75aa.png)

The size and indentation of the toggles as they are implemented today do give some ambient hints about the hierarchy of the page, so I'd also want to tweak spacing & sizing a bit to better emphasize hierarchy. You can see in the mock (where I haven't tweaked spacing yet) that the `pub fn` line looks very similar in priority to the `impl Vec` line, which is probably not desirable.

Bonus Objectives:
1. A better icon for ⓘ that more closely indicates what it is.
2. Remove or tweak ⓘ where it doesn't seem to add value. e.g. nearly every method on Vec: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.new . I'm pretty ignorant about this feature. Maybe I'll come around on it once I understand it better.

If this gets positive reception, I can build a demo of these changes.
Repository: rust
Issue: Borrow checker doesn't accept certain valid case when branch involves
Labels: T-compiler,A-NLL,NLL-polonius

The compiler currently rejects the following code:
```rust
struct X {
    next: Option<Box<X>>,
}

fn main() {
    let mut b = Some(Box::new(X { next: None }));
    let mut p = &mut b;
    while let Some(now) = p {
        if true {
            p = &mut now.next;
        }
    }
}
```

It complains that `now` double mutably borrows `p.0`.

This explanation is not very convincing. If you rewrite it this way:
```rust
    while let Some(now) = p {
        p = &mut now.next;
    }
```
the compile would happily accept it, and compiler certainly also accepts
```rust
    while let Some(now) = p {
        // empty body
    }
```
so basically whatever the condition of `if` evaluates to, the original code should always be valid in terms of borrowing.

I'm not sure if I'm missing something, but it seems to me this is a bug of the borrow checker?
Repository: rust
Issue: Rust fails to optimize away useless unwrap check
Labels: A-LLVM,I-slow,T-compiler,C-optimization

See the following code:
```rust
pub struct ListNode {
    next: Option<Box<ListNode>>
}

pub fn foo(mut head: Box<ListNode>) -> Box<ListNode> {
    let mut cur = &mut head;
    while let Some(next) = std::mem::replace(&mut cur.next, None) {
        cur.next = Some(next);
        cur = cur.next.as_mut().unwrap();
    }
    head
}
```

Apparently the `unwrap` should never panic given the assignment in the previous line. However, based on the assembly output, that check isn't optimized away.

(The `while let` statement seems to be generating useless function calls for drop as well, btw.)
Repository: flutter
Issue: Add a way to detect keyboard language
Labels: a: text input,c: new feature,framework,engine,P2,team-engine,triaged-engine

Can you please add a way to detect the keyboard language and a way to detect when the uses switches to another language?
This is needed for setting TextInput direction to RTL / LTR based on the currently selected keyboard language.
Repository: create-react-app
Issue: Build fails after eject: Cannot find module '@babel/plugin-transform-react-jsx'
Labels: issue: needs investigation

### Is this a bug report?

Yes

### Environment

```
Environment Info:

  System:
    OS: Linux 4.18 Fedora 29 (Workstation Edition) 29 (Workstation Edition)
    CPU: x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  Binaries:
    Node: 10.13.0 - /usr/bin/node
    Yarn: 1.12.3 - ~/.npm-packages/bin/yarn
    npm: 6.4.1 - /usr/bin/npm
  Browsers:
    Chrome: 70.0.3538.102
    Firefox: 63.0.1
  npmPackages:
    react: ^16.7.0 => 16.7.0 
    react-dom: ^16.7.0 => 16.7.0 
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to Reproduce

1. `npx create-react-app project`
2. `cd project`
3. `yarn eject`
4. `yarn build`

### Expected Behavior

Build success.

### Actual Behavior

Build fails.

```
Creating an optimized production build...
Failed to compile.

./src/index.js
Error: [BABEL] /tmp/project/src/index.js: Cannot find module '@babel/plugin-transform-react-jsx' (While processing: "/tmp/project/node_modules/babel-preset-react-app/index.js$1")
    at Array.reduce (<anonymous>)
```

After eject, there's no `@babel/plugin-transform-react-jsx` module inside `./node_modules`, `./node_modules/babel-preset-react-app/node_modules` or `./node_modules/babel-preset-react-app/node_modules/@babel/preset-react/node_modules`.

I need to delete the whole `node_modules` and re-run `yarn` to make it work.
Repository: TypeScript
Issue: Conditional type does not narrow union type
Labels: Bug,Domain: Conditional Types

**TypeScript Version:**  3.2.2

**Search Terms:** conditional types, unions, narrowing

**Code**

```ts
    interface A<T> {
        value: T;
    }

    interface Specification {
        [key: string]: Array<any> | Specification;
    }

    type Mapping<S extends Specification> = {
        [key in keyof S]: S[key] extends Array<infer T> ? A<T> : Mapping<S[key]>
        // Error                                                         ^^^^^^
        // Type 'S[key]' does not satisfy the constraint 'Specification'.
        //   Type 'Specification[key]' is not assignable to type 'Specification'.
        //     Type 'any[] | Specification' is not assignable to type 'Specification'.
        //       Type 'any[]' is not assignable to type 'Specification'.
        //         Index signature is missing in type 'any[]'.
    };
```

**Expected behavior:**
No error. "Leafs" of the `Specification` tree, which have type `Array<T>` (for some `T`) should be mapped to `A<T>`, while non-leaf properties should be recursively mapped.

**Actual behavior:**
In the right-hand side of the conditional type, `S[key]` is not narrowed to `Specification`, even if the complete type of `S[key]` is `Array<any> | Specification` and the `Array<any>` case is catched in the left-hand side.

**Playground Link:** [link](http://www.typescriptlang.org/play/#src=%0D%0Ainterface%20A%3CT%3E%20%7B%0D%0A%20%20%20%20value%3A%20T%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Specification%20%7B%0D%0A%20%20%20%20%5Bkey%3A%20string%5D%3A%20Array%3Cany%3E%20%7C%20Specification%3B%0D%0A%7D%0D%0A%0D%0Atype%20Mapping%3CS%20extends%20Specification%3E%20%3D%20%7B%0D%0A%20%20%20%20%5Bkey%20in%20keyof%20S%5D%3A%20S%5Bkey%5D%20extends%20Array%3Cinfer%20T%3E%20%3F%20A%3CT%3E%20%3A%20Mapping%3CS%5Bkey%5D%3E%0D%0A%7D%3B%0D%0A)

**Related Issues**: some similar issues related to conditional types, but I'm not sure whether this is a duplicate of any of them.
Repository: go
Issue: doc: runtime/pprof documentation needs clarification
Labels: Documentation,NeedsInvestigation

The documentation is not clear regarding what exactly pprof shows. Here are a few examples.

```
go tool pprof -http=":8081" http://localhost:8080/debug/pprof/profile?seconds=30
```

Let's open the flamegraph. There are at least two possibilities:
1. The flamegraph shows the clock time spent with given stacktrace
2. The flamegraph shows on-CPU time spent with given stacktrace, i.e. clock time excluding the time spent waiting for disk/network I/O or execution of other programs.

Since I/O can be quite slow these are very different options. Both reports are useful depending on what bottleneck we are trying to fix (I/O or CPU).

```
go tool pprof -http=":8081" http://localhost:8080/debug/pprof/heap
```

I'm assuming the flamegraph shows places where given amount of memory was allocated. However it's not clear whether this is 1) the total amount of allocated memory (i.e. it doesn't matter if it was freed), 2) amount of allocated memory of objects that are currently alive, or 3) amount of memory of objects that are not garbage collected yet. Without proper documentation there is no way to tell which option, if any, is correct.

```
go tool pprof -http=":8081" http://localhost:8080/debug/pprof/block
```

The time shown doesn't make much sense. On the flamegraph I see something like `18988816179 usec` i.e. 5 hours. However the program was executing only for a few minutes. I guess the time should be divided by the number of CPUs or maybe by the number of goroutines (what if it varies?).
Repository: opencv
Issue: Cannot open video file and IP camera and Compile warning with OpenCV 4.0.1
Labels: priority: low,category: videoio,incomplete

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

Please:

* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.


This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 4.0.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017
-->

- OpenCV => 4.0.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017

##### Detailed description
**It is the compiling warning:**

> CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
>   CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
>   directory
> Call Stack (most recent call first):
>   CMakeLists.txt:1056 (include)

**It is the error when opening a video file .avi, mp4 ...etc:**
`capture.open("C:/video/video1.mp4");`
> GStreamer: Error opening bin: no element "0"
> warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
> warning: 0®¯Õ< (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
> 
> (app.exe:87656): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed

**And it is when opening IP camera:**
`capture.open("rtmp://live.hkstv.hk.lxdns.com:1935/live/hks");`
> GStreamer: Error opening bin: no element "X"
> warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
> warning: X®¯Õ< (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
> 
> (app.exe:87656): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed

**_Only USB or Integrated camera can be opened_**

**Note:**

- I have build OpenCV with GStreamer 1.0
- With intel Inference_Engine
- With extra modules

_Before everything was working very well._

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->