: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<title>CodeMirror: Go mode</title>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../theme/elegant.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="go.js"></script>
<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Go</a>
<form><textarea id="code" name="code">
// Taken from the Go specification.
// Copyright © The Go Authors.
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func generate(ch chan<- int) {
ch <- i // Send 'i' to channel 'ch'
// Copy the values from channel 'src' to channel 'dst',
// removing those divisible by 'prime'.
func filter(src <-chan int, dst chan<- int, prime int) {
for i := range src { // Loop over values received from 'src'.
dst <- i // Send 'i' to channel 'dst'.
// The prime sieve: Daisy-chain filter processes together.
ch := make(chan int) // Create a new channel.
go generate(ch) // Start generate() as a subprocess.
go filter(ch, ch1, prime)
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
<p><strong>MIME type:</strong> <code>text/x-go</code></p>