def _get_most_specific_setting(name, view, window):

    # The Sublime Text API is not threadsafe in ST2, so we
    # double check here to prevent crashes
    if not isinstance(threading.current_thread(), threading._MainThread):
        raise RuntimeError('golangconfig.setting_value() must be called from the main thread')

    if view is not None and not isinstance(view, sublime.View):
        raise TypeError('view must be an instance of sublime.View, not %s' % _type_name(view))

    if window is not None and not isinstance(window, sublime.Window):
        raise TypeError('window must be an instance of sublime.Window, not %s' % _type_name(window))

    st_settings = sublime.load_settings('golang.sublime-settings')

    view_settings = view.settings().get('golang', {}) if view else {}

    if view and not window:
        window = view.window()

    window_settings = {}
    if window:
        if sys.version_info >= (3,) and window.project_data():
            window_settings = window.project_data().get('settings', {}).get('golang', {})
        elif not view and window.active_view():
            window_settings = window.active_view().settings().get('golang', {})

    settings_objects = [
        (view_settings, 'project file'),
        (window_settings, 'project file'),
        (st_settings, 'golang.sublime-settings'),
    ]

    for settings_object, source in settings_objects:
        platform_settings = settings_object.get(_platform, _NO_VALUE)
        if platform_settings == _NO_VALUE:
            continue
        if not isinstance(platform_settings, dict):
            continue
        if platform_settings.get(name, _NO_VALUE) != _NO_VALUE:
            return (platform_settings.get(name), source + ' (os-specific)')

    for settings_object, source in settings_objects:
        result = settings_object.get(name, _NO_VALUE)
        if result != _NO_VALUE:
            return (settings_object.get(name), source)

    return (_NO_VALUE, None)
Looks up a setting in the following order:
dataset/ETHPy150Open golang/sublime-config/all/golangconfig.py/_get_most_specific_setting