This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mapbench | |
import ( | |
"sync" | |
log "github.com/sirupsen/logrus" | |
) | |
type MapBench struct { | |
objects sync.Map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(index). | |
-export([do_index/1, show_file_contents/1]). | |
%% Main entrypoint | |
%% In the Erlang shell, execute: rp(index:do_index("path_to_file")). | |
%% Reads the contents of the file using the provided functions, builds up a map | |
%% of words to their locations, compresses the locations to ranges and returns a | |
%% list sorted in alphabetical order | |
do_index(Name) -> | |
Lines = get_file_contents(Name), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Curry do | |
defmacro defcurry({func_name, _func_ctx, args}, do: body) do | |
num_args = Enum.count(args) | |
if num_args - 1 >= 1 do | |
new_args = Enum.take(args, num_args - 1) | |
quote do | |
def unquote(func_name)(unquote_splicing(args)) do | |
unquote(body) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package otgrpc | |
import ( | |
context "golang.org/x/net/context" | |
"github.com/opentracing/opentracing-go" | |
"github.com/opentracing/opentracing-go/ext" | |
"github.com/opentracing/opentracing-go/log" | |
"google.golang.org/grpc" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package x_test | |
import ( | |
"context" | |
"testing" | |
"go.uber.org/zap" | |
"go.uber.org/zap/zaptest" | |
"github.com/cerbos/cerbos/client" |
OlderNewer