base, conf := regionlang.Find("by")
вроде работает:Index: language/tags.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/language/tags.go b/language/tags.go
--- a/language/tags.go (revision fb697c0580b4b6ab0a21ca17e64788b981fb6018)
+++ b/language/tags.go (date 1691299509976)
@@ -142,4 +142,5 @@
SimplifiedChinese Tag = Tag(compact.SimplifiedChinese)
TraditionalChinese Tag = Tag(compact.TraditionalChinese)
Zulu Tag = Tag(compact.Zulu)
+ Belorusian Tag = Tag(compact.Belorusian)
)
Index: internal/language/compact/tags.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/internal/language/compact/tags.go b/internal/language/compact/tags.go
--- a/internal/language/compact/tags.go (revision fb697c0580b4b6ab0a21ca17e64788b981fb6018)
+++ b/internal/language/compact/tags.go (date 1691299495704)
@@ -88,4 +88,5 @@
SimplifiedChinese Tag = Tag{language: zhHansIndex, locale: zhHansIndex}
TraditionalChinese Tag = Tag{language: zhHantIndex, locale: zhHantIndex}
Zulu Tag = Tag{language: zuIndex, locale: zuIndex}
+ Belorusian Tag = Tag{language: beBYIndex, locale: beBYIndex}
)
Index: find.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/find.go b/find.go
--- a/find.go (revision edd88e394d22f289149b1b0a5b7fb7bfe13c01ef)
+++ b/find.go (date 1691299614522)
@@ -168,4 +168,5 @@
language.SimplifiedChinese,
language.TraditionalChinese,
language.Zulu,
+ language.Belorusian,
}
replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5
replace (
golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5
golang.org/x/net => example.com/fork/net v1.4.5
golang.org/x/net v1.2.3 => ./fork/net
golang.org/x/net => ./fork/net
)
func (s *PrimaryServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
tabID := r.URL.Query().Get("tabId")
log.Printf("Websocket connected (primary): %s, %s\n", r.RemoteAddr, r.URL)
defer log.Printf("Websocket disconnected (primary): %s, %s\n", r.RemoteAddr, r.URL)
conn, err := s.upgrader.Upgrade(w, r, nil)
if err != nil {
log.Printf("Websocket upgrade error for %s: %v\n", r.RemoteAddr, err)
return
}
var sessionID string
cookie, _ := r.Cookie(s.cookieSessionID)
if cookie != nil {
sessionID = cookie.Value
}
if sessionID == "" {
return
}
user, err := s.findUser(r)
if err != nil {
log.Printf("can't find user in websocker request: %s", err)
return
}
s.serve(r, conn, sessionID, TabID(tabID), user.User())
}
function reconnectWebSocket() {
if (ws.current != null && ws.current.readyState !== WebSocket.CLOSED)
return;
const wsProtocol = window.location.protocol === "https:" ? "wss" : "ws";
let apiHost = apiEndpoint();
if (apiHost !== "") {
apiHost = apiHost.substr(apiHost.indexOf("://") + "://".length);
} else {
apiHost = window.location.host;
}
ws.current = new WebSocket(`${wsProtocol}://${apiHost}/websocket?tabId=${getTabId()}`);
ws.current.onmessage = onMessage;
}
curl http://localhost:8000
там же, где вы запускаете тесты.argv.Addr
- :8000
или что-то другое? go test -bench=. -benchtime=1x -count=10 -benchmem -cpu=1
Benchmark_Stdlog 1 44000 ns/op 11168 B/op 35 allocs/op
Benchmark_Stdlog 1 10350 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 9900 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 3600 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 3390 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 3080 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 2910 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 2890 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 2850 ns/op 152 B/op 3 allocs/op
Benchmark_Stdlog 1 2880 ns/op 152 B/op 3 allocs/op
Вывод: доверять бенчмаркам в этой части нельзя, если используется переиспользование чего-либо.
Benchmark_Stdlog-4 1 46619 ns/op 11552 B/op 35 allocs/op
Benchmark_Stdlog-4 1 10380 ns/op 536 B/op 3 allocs/op
Benchmark_Stdlog-4 1 18110 ns/op 536 B/op 3 allocs/op
Benchmark_Stdlog-4 1 13820 ns/op 760 B/op 5 allocs/op
Benchmark_Stdlog-4 1 10880 ns/op 760 B/op 5 allocs/op
Benchmark_Stdlog-4 1 12119 ns/op 760 B/op 5 allocs/op
Benchmark_Stdlog-4 1 9430 ns/op 536 B/op 3 allocs/op
Benchmark_Stdlog-4 1 7560 ns/op 536 B/op 3 allocs/op
Benchmark_Stdlog-4 1 5040 ns/op 536 B/op 3 allocs/op
Benchmark_Stdlog-4 1 9800 ns/op 760 B/op 5 allocs/op