Help us understand the problem. What is going on with this article?

Macだと標準入力の最大文字数は1024文字(?)

More than 5 years have passed since last update.

Goの標準入力のサンプル(下記)をMacで動かしていたら1024文字以上入力できなくて、returnも押せなかった。(1文字消したらreturnできたから、return込みで1024文字)
http://golang.org/pkg/bufio/#example_Scanner_lines

package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    for scanner.Scan() {
        fmt.Println(scanner.Text()) // Println will add back the final '\n'
    }
    if err := scanner.Err(); err != nil {
        fmt.Fprintln(os.Stderr, "reading standard input:", err)
    }
}

最初、Goの最大文字数制限に引っかかっているのかと思って調べていたが、実はMacの制限らしい。
MacOSX 10.6.7 cuts off stdin at 1024 chars
pexpect can't pass input over 1024 chars?
公式なドキュメントは見つからなかったので確信は持てない。
この制限を変えられる設定とかも見つけられませんでした。

まぁ、標準入力なら1024文字あれば大丈夫でしょうけど。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした